Skip to content

WIP: Experimental version of using GraalVM to statically compile the XMLValidator to native binaries for macOS, Linux and Windows #1

WIP: Experimental version of using GraalVM to statically compile the XMLValidator to native binaries for macOS, Linux and Windows

WIP: Experimental version of using GraalVM to statically compile the XMLValidator to native binaries for macOS, Linux and Windows #1

name: GraalVM Native Image builds
on: [push, pull_request]
jobs:
build:
name: XMLValidator on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Build and run XMLValidator.java
run: |
cd support
javac XMLValidator.java
native-image -march=compatibility XMLValidator -o dist/XMLValidator-${{ matrix.os }}
stat dist/XMLValidator
- name: Commit and push binaries
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull
git add .
git commit -m "build: update binaries for ${{ matrix.os }}"
git push
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: XMLValidator-${{ matrix.os }}
path: support/dist/XMLValidator*
if-no-files-found: error