klokwrk-tool-gradle-source-repack GraalVM native image builder #159
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: klokwrk-tool-gradle-source-repack GraalVM native image builder | |
on: workflow_dispatch | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ linux, macos] | |
include: | |
- os: 'linux' | |
version: 'ubuntu-latest' | |
label: 'linux' | |
native-image-name: 'klokwrk-tool-gradle-source-repack' | |
- os: 'macos' | |
version: 'macos-latest' | |
label: 'mac' | |
native-image-name: 'klokwrk-tool-gradle-source-repack' | |
runs-on: ${{ matrix.version }} | |
name: ${{ matrix.version }} - GraalVM native image build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # We need a full history here because the Gradle Jgitver plugin requires it for calculating the correct project version. | |
- name: Set up GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 17.0.7 | |
distribution: graalvm-community | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Assemble | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue --exclude-task groovydoc --scan clean assemble testClasses | |
- name: Test Unit | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue --scan check | |
- name: Get upload version | |
shell: bash | |
run: | | |
echo "UPLOAD_VERSION=$(./gradlew --quiet --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack properties | grep "^version:." | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Jar upload | |
if: ${{ matrix.label == 'linux' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: klokwrk-tool-gradle-source-repack_${{ env.UPLOAD_VERSION }}-jar | |
path: modules/other/tool/klokwrk-tool-gradle-source-repack/build/libs/*-all.jar | |
- name: Build GraalVM native image | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue --scan kwrkNativeImage | |
- name: GraalVM native image upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: klokwrk-tool-gradle-source-repack_${{ env.UPLOAD_VERSION }}-${{ matrix.label }} | |
path: modules/other/tool/klokwrk-tool-gradle-source-repack/build/native-image/${{ matrix.native-image-name }} | |
build-windows: | |
strategy: | |
matrix: | |
os: [ windows ] | |
include: | |
- os: 'windows' | |
version: 'windows-latest' | |
label: 'win' | |
native-image-name: 'klokwrk-tool-gradle-source-repack.exe' | |
runs-on: ${{ matrix.version }} | |
name: ${{ matrix.version }} - GraalVM native image build | |
steps: | |
- name: Support long paths for Windows | |
run: git config --system core.longpaths true | |
- name: Set up Windows 1/2 - Configure environment for compiling C/C++ code | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Set up Windows 2/2 - Configure MSBuild tool | |
uses: microsoft/setup-msbuild@v1 | |
- name: Configure Windows pagefile | |
uses: al-cheb/configure-pagefile-action@v1.3 | |
with: | |
minimum-size: 10GB | |
maximum-size: 12GB | |
disk-root: "C:" | |
- name: Set up Windows pagefile | |
run: | | |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: 17.0.7 | |
distribution: graalvm-community | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Assemble | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue --exclude-task groovydoc --scan clean assemble testClasses | |
- name: Test Unit | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue --scan check | |
- name: Get upload version | |
shell: bash | |
run: | | |
echo "UPLOAD_VERSION=$(./gradlew --quiet --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack properties | grep "^version:." | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Build GraalVM native image for windows | |
shell: cmd | |
run: | | |
./gradlew.bat --project-dir modules/other/tool/klokwrk-tool-gradle-source-repack --continue kwrkNativeImage | |
- name: GraalVM native image upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: klokwrk-tool-gradle-source-repack_${{ env.UPLOAD_VERSION }}-${{ matrix.label }} | |
path: modules/other/tool/klokwrk-tool-gradle-source-repack/build/native-image/${{ matrix.native-image-name }} |