Skip to content

Commit b230fa8

Browse files
authoredAug 16, 2024··
Fix binaries artifact names when built on tags (#1569)
Our `binaries` workflow builds artifacts for linux and macos of our main executables. On tags, it should produce artifacts named `hydra-<arch>-<os>-<version>.zip` or otherwise the tutorial instructions do not work. Also, we would like to have clean artifacts to be included in release notes. ### Problem For some reason the `git describe` was reporting a version x commits ahead of the previous release, instead of just the name of the latest tag. ### Solution :detective: Fixes version determination by refetching tags before calling `git describe`. :detective: Runs binaries workflow not on every push, but only on PRs, important branches and obviously tags. Fixed workflow on a temporary `0.0.0-test` tag: https://github.com/cardano-scaling/hydra/actions/runs/10417337202 --- * [x] CHANGELOG update not needed * [x] Documentation update not needed * [x] Haddocks update not needed * [x] No new TODOs introduced
2 parents 6a37a2c + f5e2a67 commit b230fa8

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed
 

‎.github/workflows/binaries.yaml

+17-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ name: Binaries
44
on:
55
push:
66
branches:
7-
- "**"
7+
- main
8+
- release
89
tags:
910
- "*.*.*"
11+
pull_request:
1012

1113
jobs:
1214
# Produces static ELF binary for using MuslC which includes all needed
@@ -34,11 +36,17 @@ jobs:
3436
name: cardano-scaling
3537
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'
3638

39+
- name: 🕵 Determine version
40+
run: |
41+
# NOTE: For some reason the fetched tags on checkout are not effective
42+
# and we need to refetch with --force for git describe.
43+
git fetch --tags --force
44+
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
45+
3746
- name: ❄ Build static executables
3847
run: |
3948
nix build .#release-static
4049
# XXX: Why unzip https://github.com/actions/upload-artifact/issues/39
41-
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
4250
unzip result/*.zip -d out
4351
4452
- name: 💾 Upload executables
@@ -72,11 +80,17 @@ jobs:
7280
name: cardano-scaling
7381
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'
7482

83+
- name: 🕵 Determine version
84+
run: |
85+
# NOTE: For some reason the fetched tags on checkout are not effective
86+
# and we need to refetch with --force for git describe.
87+
git fetch --tags --force
88+
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
89+
7590
- name: ❄ Build executables
7691
run: |
7792
nix build .#release
7893
# XXX: Why unzip https://github.com/actions/upload-artifact/issues/39
79-
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
8094
unzip result/*.zip -d out
8195
8296
- name: 💾 Upload executables

0 commit comments

Comments
 (0)
Please sign in to comment.