Skip to content

Commit

Permalink
TS-0 Fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Klein committed Dec 3, 2024
1 parent 9bf86b5 commit 57aa916
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/build-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
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
Expand Down Expand Up @@ -35,7 +40,7 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: target-linux
name: ${{ env.LINUX_ARTIFACT_NAME }}
path: ./target
retention-days: 5

Expand All @@ -58,7 +63,7 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: target-mac
name: ${{ env.MAC_ARTIFACT_NAME }}
path: ./target
retention-days: 5

Expand All @@ -81,7 +86,7 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: target-windows
name: ${{ env.WINDOWS_ARTIFACT_NAME }}
path: ./target
retention-days: 5

Expand All @@ -93,19 +98,25 @@ jobs:
- build-windows-graalvm
name: Create Release
runs-on: ubuntu-latest
env:
DISTRIBUTIONS_DIR: ./teamscale-upload-dists
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
path: ${{ env.DISTRIBUTIONS_DIR }}
- 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)
(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: teamscale-upload-*.zip
file: ${{ env.DISTRIBUTIONS_DIR }}/teamscale-upload-*.zip
file_glob: true
overwrite: true
26 changes: 16 additions & 10 deletions .github/workflows/build-jlink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
pull_request:
branches: '*'

env:
ARTIFACT_NAME: target-jlink

jobs:
# builds the jlink versions of the teamscale-upload tool and stores them in a temporary gradle-workflow storage
build-jlink:
Expand Down Expand Up @@ -38,7 +41,7 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: target-jlink
name: ${{ env.ARTIFACT_NAME }}
# Path to generated jlink distributions on the current machine.
#
# We prefer to list the paths explicitly (rather than copy the entire folder) to document
Expand All @@ -61,23 +64,26 @@ jobs:
- build-jlink
name: Create Release (jlink)
runs-on: ubuntu-latest
env:
DISTRIBUTIONS_DIR: ./teamscale-upload-dists
steps:
- uses: actions/download-artifact@v3
- name: List downloaded distributions
run: ls -1 target-jlink
- uses: actions/download-artifact@v4
with:
path: ${{ env.DISTRIBUTIONS_DIR }}
- name: Rename Distributions
run: |
(mv ./target-jlink/teamscale-upload-linux-x86_64.zip ./target-jlink/teamscale-upload-jlink-linux-x86_64.zip)
(mv ./target-jlink/teamscale-upload-windows-x86_64.zip ./target-jlink/teamscale-upload-jlink-windows-x86_64.zip)
(mv ./target-jlink/teamscale-upload-macos-x86_64.zip ./target-jlink/teamscale-upload-jlink-macos-x86_64.zip)
(mv ./target-jlink/teamscale-upload-macos-aarch64.zip ./target-jlink/teamscale-upload-jlink-macos-aarch64.zip)
(ls -1 target-jlink)
(cd $DISTRIBUTIONS_DIR/${ARTIFACT_NAME} && mv teamscale-upload-linux-x86_64.zip ../teamscale-upload-jlink-linux-x86_64.zip)
(cd $DISTRIBUTIONS_DIR/${ARTIFACT_NAME} && mv teamscale-upload-windows-x86_64.zip ../teamscale-upload-jlink-windows-x86_64.zip)
(cd $DISTRIBUTIONS_DIR/${ARTIFACT_NAME} && mv teamscale-upload-macos-x86_64.zip ../teamscale-upload-jlink-macos-x86_64.zip)
(cd $DISTRIBUTIONS_DIR/${ARTIFACT_NAME} && mv teamscale-upload-macos-aarch64.zip ../teamscale-upload-jlink-macos-aarch64.zip)
- 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: target-jlink/teamscale-upload-jlink-*.zip
file: ${{ env.DISTRIBUTIONS_DIR }}/teamscale-upload-jlink-*.zip
file_glob: true
overwrite: true

0 comments on commit 57aa916

Please sign in to comment.