Skip to content

Commit

Permalink
Split packaging into multiple jobs, add gather job
Browse files Browse the repository at this point in the history
  • Loading branch information
rnijveld committed Mar 26, 2024
1 parent a9200e1 commit e628e91
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/packaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
jobs:
package:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
steps:
- name: Setup packaging tools for cross compiled artifacts
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
Expand All @@ -37,8 +44,30 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Build the release binaries
run: utils/build-release.sh
run: RELEASE_TARGETS="${{ matrix.target }}" utils/build-release.sh

- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: release-binaries-${{ matrix.target }}
path: target/pkg/
if-no-files-found: error

gather:
needs: package
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
pattern: release-binaries-*
path: target/pkg/
merge-multiple: true
- name: Create a SHA256SUMS file
run: |
cd target/pkg/
rm -rf SHA256SUMS
sha256sum -b * > SHA256SUMS
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
Expand All @@ -47,7 +76,7 @@ jobs:
if-no-files-found: error

release:
needs: package
needs: gather
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
steps:
Expand Down Expand Up @@ -96,5 +125,5 @@ jobs:
fail_on_unmatched_files: true
tag_name: "v${{ env.release_version }}"
files: target/pkg/*
body: "${{ env.release_notes_body}}"
body: "${{ env.release_notes_body }}"

3 changes: 2 additions & 1 deletion utils/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -eo pipefail

targets=("aarch64-unknown-linux-gnu" "armv7-unknown-linux-gnueabihf" "x86_64-unknown-linux-gnu" "i686-unknown-linux-gnu")
: "${RELEASE_TARGETS:=aarch64-unknown-linux-gnu,armv7-unknown-linux-gnueabihf,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu}"
IFS=',' read -r -a targets <<< "$RELEASE_TARGETS"

target_dir="target/pkg"

Expand Down

0 comments on commit e628e91

Please sign in to comment.