Skip to content

Commit

Permalink
Add second matrix strategy native-image job for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
paytoncain committed Apr 9, 2024
1 parent 99e59ae commit 25baa13
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ jobs:
name: python-package
path: "dist/*.tar.gz"

native-image:
native-image-unix:
needs: build
strategy:
matrix:
os: [macos-14,macos-11,ubuntu-20.04,windows-2019]
os: [macos-14,macos-11,ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK 17
Expand All @@ -91,21 +91,7 @@ jobs:
name: reflection-config
- name: Build Executable
run: native-image -jar pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar -H:Name=pace-cli -H:ReflectionConfigurationFiles=native-reflection-configuration.json -H:-CheckToolchain
- name: Print Runner OS
run: |
if [ "${{ matrix.os }}" == *"windows"* ]; then
echo "Runner OS: $env:RUNNER_OS"
else
echo "Runner OS: $RUNNER_OS"
fi
- name: Print Runner Architecture
run: |
if [ "${{ matrix.os }}" == *"windows"* ]; then
echo "Runner Architecture: $env:RUNNER_ARCH"
else
echo "Runner Architecture: $RUNNER_ARCH"
fi
- name: Set env vars
- name: Set os/arch environment variables
run: |
echo "os=${RUNNER_OS}" >> $GITHUB_ENV
echo "arch=${RUNNER_ARCH}" >> $GITHUB_ENV
Expand All @@ -115,6 +101,38 @@ jobs:
name: pace-cli-${{ env.os }}-${{ env.arch }}
path: "pace-cli"

native-image-windows:
needs: build
strategy:
matrix:
os: [ windows-2019 ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK 17
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm'
- name: Download Jar
uses: actions/download-artifact@v4
with:
name: exe-jar
- name: Download Native Reflection Configuration
uses: actions/download-artifact@v4
with:
name: reflection-config
- name: Build Executable
run: native-image -jar pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar -H:Name=pace-cli -H:ReflectionConfigurationFiles=native-reflection-configuration.json -H:-CheckToolchain
- name: Set os/arch environment variables
run: |
echo "os=${env:RUNNER_OS}" >> $GITHUB_ENV
echo "arch=${env:RUNNER_ARCH}" >> $GITHUB_ENV
- name: Upload Executable
uses: actions/upload-artifact@v4
with:
name: pace-cli-${{ env.os }}-${{ env.arch }}
path: "pace-cli.exe"

release:
needs:
- build
Expand All @@ -126,7 +144,8 @@ jobs:
- run: mkdir release
- run: zip -r release/pace-cli-Linux-X64-${{ needs.build.outputs.version }}.zip pace-cli-Linux-X64
- run: zip -r release/pace-cli-macOS-ARM64-${{ needs.build.outputs.version }}.zip pace-cli-macOS-ARM64
- run: zip -r release/pace-cli-macOS-X64-${{ needs.build.outputs.version }}.zip pace-cli-macOS-X64
- run: zip -r release/pace-cli-macOS-X64-${{ needs.build.outputs.version }}.zip pace-cli-macOS-X64
- run: zip -r release/pace-cli-Windows-X64-${{ nees.build.outputs.version }}.zip pace-cli-Windows-X64
- run: cp python-package/*.tar.gz release/.
- run: cp exe-jar/pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar release/pace-cli-${{ needs.build.outputs.version }}.jar
- name: Update branch release
Expand Down

0 comments on commit 25baa13

Please sign in to comment.