ci: drop the file(1) check, and take the version from the tag input
The runner image has no file(1), and ldd already answers the only question that matters. Taking the version from TAG rather than GITHUB_REF_NAME also makes a workflow_dispatch rebuild name its artifacts after the tag it built, not the branch it was dispatched from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
63a7159 parent: 95124a2 modified
.rickub/workflows/release.yml +5 -2 | @@ -61,12 +61,15 @@ jobs: | ||
| 61 | 61 | run: nim c -d:release -d:ssl --hints:off -o:nimstatic-host src/nimstatic.nim |
| 62 | 62 | |
| 63 | 63 | - name: Build the static binary with itself |
| 64 | + env: | |
| 65 | + TAG: ${{ inputs.tag || github.ref_name }} | |
| 64 | 66 | run: | |
| 65 | 67 | set -euo pipefail |
| 66 | - VERSION="${GITHUB_REF_NAME#v}" | |
| 68 | + VERSION="${TAG#v}" | |
| 67 | 69 | NAME="nimstatic-${VERSION}-x86_64-linux" |
| 68 | 70 | ./nimstatic-host src/nimstatic.nim -o "$NAME" -- -d:ssl --passL:-s |
| 69 | - file "$NAME" | |
| 71 | + # `file` is not on the runner image; ldd answers the only question | |
| 72 | + # that matters, and running it proves the thing actually starts. | |
| 70 | 73 | ldd "$NAME" 2>&1 | grep -q "not a dynamic executable" |
| 71 | 74 | ./"$NAME" --help > /dev/null |
| 72 | 75 | xz -9e -k "$NAME" |
| @@ -61,12 +61,15 @@ jobs: | |||
| 61 | run: nim c -d:release -d:ssl --hints:off -o:nimstatic-host src/nimstatic.nim | 61 | run: nim c -d:release -d:ssl --hints:off -o:nimstatic-host src/nimstatic.nim |
| 62 | 62 | ||
| 63 | - name: Build the static binary with itself | 63 | - name: Build the static binary with itself |
| 64 | + env: | ||
| 65 | + TAG: ${{ inputs.tag || github.ref_name }} | ||
| 64 | run: | | 66 | run: | |
| 65 | set -euo pipefail | 67 | set -euo pipefail |
| 66 | - VERSION="${GITHUB_REF_NAME#v}" | 68 | + VERSION="${TAG#v}" |
| 67 | NAME="nimstatic-${VERSION}-x86_64-linux" | 69 | NAME="nimstatic-${VERSION}-x86_64-linux" |
| 68 | ./nimstatic-host src/nimstatic.nim -o "$NAME" -- -d:ssl --passL:-s | 70 | ./nimstatic-host src/nimstatic.nim -o "$NAME" -- -d:ssl --passL:-s |
| 69 | - file "$NAME" | 71 | + # `file` is not on the runner image; ldd answers the only question |
| 72 | + # that matters, and running it proves the thing actually starts. | ||
| 70 | ldd "$NAME" 2>&1 | grep -q "not a dynamic executable" | 73 | ldd "$NAME" 2>&1 | grep -q "not a dynamic executable" |
| 71 | ./"$NAME" --help > /dev/null | 74 | ./"$NAME" --help > /dev/null |
| 72 | xz -9e -k "$NAME" | 75 | xz -9e -k "$NAME" |