Skip to content

Commit

Permalink
release-upload.yaml: release aarch64-linux static binary + use x86_64…
Browse files Browse the repository at this point in the history
…-linux static binary
  • Loading branch information
smelc committed Jul 15, 2024
1 parent 2f3ddcd commit 268446b
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
strategy:
matrix:
# TODO generalize
arch: [x86_64-linux, x86_64-darwin, aarch64-darwin]
arch: [x86_64-linux, x86_64-darwin, aarch64-darwin, aarch64-linux]
name: "Download Asset"
runs-on: ubuntu-latest
steps:
Expand All @@ -153,7 +153,23 @@ jobs:
nix flake metadata "${{ needs.wait_for_hydra.outputs.FLAKE_REF }}" --json | jq -r '"LOCKED_URL=\(.url)"' >> "$GITHUB_ENV"
- name: Build
run: |
derivation="hydraJobs.${{ matrix.arch }}.packages.cardano-cli:exe:cardano-cli"
derivation="hydraJobs."
case ${{ matrix.arch }} in
"x86_64-darwin" | "aarch64-darwin")
derivation+="${{ matrix.arch }}"
;;
"x86_64-linux")
derivation+="x86_64-linux.x86_64-unknown-linux-musl"
;;
"aarch64-linux")
derivation+="x86_64-linux.aarch64-unknown-linux-musl"
;;
*)
echo "Unexpected matrix.arch value: ${{ matrix.arch }}"
exit 1
;;
esac
derivation+=".packages.cardano-cli:exe:cardano-cli"
nix build --builders "" --max-jobs 0 ${{ env.LOCKED_URL }}#$derivation
tree result
cp result/bin/cardano-cli cardano-cli-${{ matrix.arch }} # (1)
Expand All @@ -178,15 +194,15 @@ jobs:
# (2)
# TARGET_TAG is of the form cardano-cli-8.22.0, so we don't need to prefix the tar.gz's name
# with cardano-cli
for arch in x86_64-linux x86_64-darwin aarch64-darwin; do
for arch in x86_64-linux x86_64-darwin aarch64-darwin aarch64-linux; do
tar -czf ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-$arch.tar.gz cardano-cli-$arch
done
# TODO generalize
# zip ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip cardano-cli-win64
- name: Checksums
run: |
# (3)
for arch in x86_64-linux x86_64-darwin aarch64-darwin; do
for arch in x86_64-linux x86_64-darwin aarch64-darwin aarch64-linux; do
sha256sum ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-$arch.tar.gz >> ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-sha256sums.txt
done
- name: Create short tag
Expand All @@ -213,5 +229,6 @@ jobs:
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-x86_64-linux.tar.gz
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-x86_64-darwin.tar.gz
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-aarch64-darwin.tar.gz
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-aarch64-linux.tar.gz
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-sha256sums.txt
body_path: RELEASE_CHANGELOG.md

0 comments on commit 268446b

Please sign in to comment.