TS-0 Fix release action #94
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
name: Build-GraalVM | |
on: | |
push: | |
branches: '*' | |
tags: 'v*' | |
pull_request: | |
branches: '*' | |
env: | |
LINUX_ARTIFACT_NAME: target-linux | |
MAC_ARTIFACT_NAME: target-mac | |
WINDOWS_ARTIFACT_NAME: target-windows | |
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: ${{ env.LINUX_ARTIFACT_NAME }} | |
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: ${{ env.MAC_ARTIFACT_NAME }} | |
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: ${{ env.WINDOWS_ARTIFACT_NAME }} | |
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 | |
env: | |
DISTRIBUTIONS_DIR: ./teamscale-upload-dists | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.DISTRIBUTIONS_DIR }} | |
- name: Package | |
run: | | |
(cd $DISTRIBUTIONS_DIR/$LINUX_ARTIFACT_NAME && zip ../teamscale-upload-linux.zip teamscale-upload) | |
(cd $DISTRIBUTIONS_DIR/$MAC_ARTIFACT_NAME && zip ../teamscale-upload-mac.zip ./teamscale-upload) | |
(cd $DISTRIBUTIONS_DIR/$WINDOWS_ARTIFACT_NAME && zip ../teamscale-upload-windows.zip ./teamscale-upload.exe) | |
- name: List downloaded distributions | |
run: ls -1 $DISTRIBUTIONS_DIR/*.zip | |
- name: Upload Release Assets | |
id: create_release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ env.DISTRIBUTIONS_DIR }}/teamscale-upload-*.zip | |
file_glob: true | |
overwrite: true |