update Gradle & Maven wrapper versions. #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gradle native image build | |
on: | |
push: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} with Java ${{ matrix.java-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
java-version: [17, 21] | |
graalvm-distribution: ['graalvm-community'] | |
fail-fast: false | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Verify Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Download Liberica NIK ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} (Linux) | |
if: runner.os == 'Linux' && matrix.java-version == 17 | |
run: | | |
download_url="https://github.com/bell-sw/LibericaNIK/releases/download/23.0.4+1-17.0.11+10/bellsoft-liberica-vm-core-openjdk17.0.11+10-23.0.4+1-linux-amd64.tar.gz" | |
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url | |
- name: Download Liberica NIK ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} (Linux) | |
if: runner.os == 'Linux' && matrix.java-version == 21 | |
run: | | |
download_url="https://github.com/bell-sw/LibericaNIK/releases/download/23.1.3+2-21.0.3+10/bellsoft-liberica-vm-core-openjdk21.0.3+10-23.1.3+2-linux-amd64.tar.gz" | |
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url | |
- name: Download Liberica NIK ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} (Windows) | |
if: runner.os == 'Windows' && matrix.java-version == 21 | |
shell: cmd | |
run: | | |
set download_url="https://github.com/bell-sw/LibericaNIK/releases/download/23.1.3+2-21.0.3+10/bellsoft-liberica-vm-core-openjdk21.0.3+10-23.1.3+2-windows-amd64.zip" | |
C:\msys64\usr\bin\wget.exe -O %RUNNER_TEMP%\java_package.zip %download_url% | |
- name: Set up Liberica NIK ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} (Linux) | |
if: runner.os == 'Linux' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: jdkfile | |
java-version: ${{ matrix.java-version }} | |
jdkFile: ${{ runner.temp }}/java_package.tar.gz | |
architecture: x64 | |
- name: Set up Liberica NIK ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} (Windows) | |
if: runner.os == 'Windows' && matrix.java-version == 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: jdkfile | |
java-version: ${{ matrix.java-version }} | |
jdkFile: ${{ runner.temp }}/java_package.zip | |
architecture: x64 | |
- name: Set up a Developer Command Prompt for Microsoft Visual C++ (Windows) | |
if: runner.os == 'Windows' && matrix.java-version == 21 | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Set up GraalVM ${{ matrix.graalvm-distribution }} for Java ${{ matrix.java-version }} | |
if: runner.os == 'Windows' && matrix.java-version == 17 | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: ${{ matrix.graalvm-distribution }} | |
- name: Report Java version | |
run: | | |
java -version | |
javac -version | |
- name: Install libxi-dev in Linux | |
if: runner.os == 'Linux' | |
run: sudo apt-get install -y libxi-dev | |
- name: Build with Gradle Wrapper (Linux) | |
run: | | |
cd trunk/SwingSet3 | |
./gradlew --no-daemon --info nativeCompile | |
if: runner.os != 'Windows' | |
- name: Build with Gradle Wrapper (Windows) | |
run: | | |
cd trunk\SwingSet3 | |
.\gradlew.bat --no-daemon --info nativeCompile | |
if: runner.os == 'Windows' | |
- name: Package Linux artifacts | |
if: runner.os == 'Linux' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SwingSet3 ${{ runner.os }} native image with SubstrateVM for Java ${{ matrix.java-version }} | |
path: | | |
trunk/SwingSet3/build/native/nativeCompile/ | |
!trunk/SwingSet3/build/native/nativeCompile/reports | |
!trunk/SwingSet3/build/native/nativeCompile/sources | |
- name: Package Windows artifacts | |
if: runner.os == 'Windows' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SwingSet3 ${{ runner.os }} native image with SubstrateVM for Java ${{ matrix.java-version }} | |
path: | | |
trunk/SwingSet3/build/native/nativeCompile/ | |
!trunk/SwingSet3/build/native/nativeCompile/native-image-*.args | |
!trunk/SwingSet3/build/native/nativeCompile/reports | |
!trunk/SwingSet3/build/native/nativeCompile/sources | |