Add second matrix strategy native-image job for windows #55
Workflow file for this run
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ "windows-artifact" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
cache: maven | |
- name: Package | |
run: mvn -B package -Pdep-check | |
- id: version | |
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT" | |
- name: Upload Build Resources | |
uses: actions/upload-artifact@v4 | |
with: | |
name: exe-jar | |
path: "pace-cli/target/*-jar-with-dependencies.jar" | |
- name: Upload Native Reflection Configuration | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reflection-config | |
path: "pace-cli/src/main/resources/native-reflection-configuration.json" | |
- name: Prepare Python Module | |
run: "touch pace-data/target/generated-sources/python/pacedata/__init__.py && cp pace-data/target/classes/python/setup.py pace-data/target/generated-sources/python/." | |
- name: Upload Python Module | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-module | |
path: "pace-data/target/generated-sources/python" | |
package-python: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Python Module | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-module | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install Python Dependencies | |
run: python -m pip install --upgrade pip && python -m pip install setuptools | |
- name: Build Python Package | |
run: python setup.py sdist | |
- name: Upload Python Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package | |
path: "dist/*.tar.gz" | |
native-image-unix: | |
needs: build | |
strategy: | |
matrix: | |
os: [macos-14,macos-11,ubuntu-20.04] | |
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=${RUNNER_OS}" >> $GITHUB_ENV | |
echo "arch=${RUNNER_ARCH}" >> $GITHUB_ENV | |
- name: Upload Executable | |
uses: actions/upload-artifact@v4 | |
with: | |
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 | |
shell: powershell | |
- name: Upload Executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pace-cli-${{ env.os }}-${{ env.arch }} | |
path: "pace-cli.exe" | |
release: | |
needs: | |
- build | |
- native-image-unix | |
- native-image-windows | |
- package-python | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
- 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-Windows-X64-${{ needs.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 | |
uses: eine/tip@master | |
with: | |
tag: ${{ github.ref_name }}-latest | |
rm: true | |
token: ${{ secrets.RELEASE_PAT }} | |
files: release/* | |