Skip to content

Commit

Permalink
Use outputs to pass information between jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gatsik committed Sep 20, 2024
1 parent cb759df commit bea8e8e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ env:
BUILD_VERSION: ${{ github.event.inputs.version }}

jobs:
build-windows:
build_windows:
environment: deploy
runs-on: windows-latest
outputs:
MSI_SUM: ${{ steps.checksum.outputs.MSI_SUM }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -59,17 +61,19 @@ jobs:
run: |
$MSI_SUM = $(Get-FileHash dist/*).hash
Write-Host $MSI_SUM
echo "MSI_SUM=$MSI_SUM" >> "$env:GITHUB_ENV"
echo "MSI_SUM=$MSI_SUM" >> "$env:GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: client-windows
path: dist/*

build-linux:
build_linux:
runs-on: ubuntu-latest
environment: release
outputs:
TAR_SUM: ${{ steps.checksum.outputs.TAR_SUM }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -134,7 +138,7 @@ jobs:
run: |
TAR_SUM=$(echo faforever.tar.gz -n | sha256sum)
echo $TAR_SUM
echo "TAR_SUM=$TAR_SUM" >> $GITHUB_ENV
echo "TAR_SUM=$TAR_SUM" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -167,7 +171,7 @@ jobs:
with:
commit: ${{ github.sha }}
tag: ${{ github.event.inputs.version }}
body: "SHA256 (Windows): ${{ env.MSI_SUM }}\nSHA256 (Linux): ${{ env.TAR_SUM }}"
body: "SHA256 (Windows): ${{ build_windows.outputs.MSI_SUM }}\nSHA256 (Linux): ${{ build_linux.outputs.TAR_SUM }}"
draft: true
prerelease: true
artifacts: "release-artifacts/*"

0 comments on commit bea8e8e

Please sign in to comment.