TS-40724 Cherry-picked changes from fork #72
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: Build-GraalVM | |
on: | |
push: | |
branches: '*' | |
tags: 'v*' | |
pull_request: | |
branches: '*' | |
jobs: | |
build-linux-graalvm: | |
name: Linux graalvm Build | |
# Build against a fixed version, as it determines our minimal Glibc requirements. | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GraalVM | |
uses: ayltai/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
graalvm-version: 22.3.1 | |
native-image: true | |
- name: Build | |
env: | |
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }} | |
run: mvn clean verify | |
- name: Reduce Image Size | |
# As `upx` creates a statically-linked executable, the `runs-on` image | |
# above determines the minimally required version of Glibc. | |
uses: crazy-max/ghaction-upx@v1 | |
with: | |
version: latest | |
file: ./target/teamscale-upload | |
- name: 'Upload Artifact' | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target-linux | |
path: ./target | |
retention-days: 5 | |
build-mac-graalvm: | |
name: MacOS graalvm Build | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GraalVM | |
uses: ayltai/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
graalvm-version: 22.3.1 | |
native-image: true | |
- name: Build | |
env: | |
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }} | |
run: mvn clean verify | |
- name: 'Upload Artifact' | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target-mac | |
path: ./target | |
retention-days: 5 | |
build-windows-graalvm: | |
name: Windows graalvm Build | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GraalVM | |
uses: ayltai/setup-graalvm@v1 | |
with: | |
java-version: 17 | |
graalvm-version: 22.3.1 | |
native-image: true | |
- name: Build | |
env: | |
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }} | |
run: ./build-windows.bat | |
- name: 'Upload Artifact' | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target-windows | |
path: ./target | |
retention-days: 5 | |
release-graalvm: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- build-linux-graalvm | |
- build-mac-graalvm | |
- build-windows-graalvm | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
- name: Package | |
run: | | |
(cd ./target-linux && zip ../teamscale-upload-linux.zip ./teamscale-upload) | |
(cd ./target-mac && zip ../teamscale-upload-mac.zip ./teamscale-upload) | |
(cd ./target-windows && zip ../teamscale-upload-windows.zip ./teamscale-upload.exe) | |
- name: Upload Release Assets | |
id: create_release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: teamscale-upload-*.zip | |
file_glob: true | |
overwrite: true |