ci: release job — test before publish, pin bash, fix diagnostic
- Run cargo test before the build so a tag never publishes untested code. - Pin shell: bash on the scripted steps; the runner defaults to dash, which rejected `set -o pipefail` and failed run 22's package step. - Swap `file` (absent in the slim image) for `ls -l`.
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
# (aarch64, macOS, Windows) and the D3 package-manager manifests layer on later,
|
# (aarch64, macOS, Windows) and the D3 package-manager manifests layer on later,
|
||||||
# step by step.
|
# step by step.
|
||||||
#
|
#
|
||||||
# Correctness comes from the branch gate (clippy + test) that ran when the
|
# Tests run here before the build so a tag can never publish untested code,
|
||||||
# tagged commit was pushed; this job builds + publishes, it does not re-test.
|
# even one pointing at a commit that was never gated on a branch.
|
||||||
name: release
|
name: release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -24,14 +24,20 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: nix develop -c cargo test --no-fail-fast
|
||||||
|
|
||||||
- name: build static binary
|
- name: build static binary
|
||||||
run: nix develop -c cargo build --release --target "$TARGET"
|
run: nix develop -c cargo build --release --target "$TARGET"
|
||||||
|
|
||||||
- name: package artifacts
|
- name: package artifacts
|
||||||
|
# Pin bash: the runner defaults scripted steps to dash, which rejects
|
||||||
|
# `set -o pipefail`. bash is in the CI image.
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
BIN="target/$TARGET/release/rdbms-playground"
|
BIN="target/$TARGET/release/rdbms-playground"
|
||||||
file "$BIN"
|
ls -l "$BIN"
|
||||||
OUT="rdbms-playground-${{ github.ref_name }}-$TARGET"
|
OUT="rdbms-playground-${{ github.ref_name }}-$TARGET"
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp "$BIN" "dist/$OUT"
|
cp "$BIN" "dist/$OUT"
|
||||||
@@ -39,6 +45,7 @@ jobs:
|
|||||||
ls -l dist
|
ls -l dist
|
||||||
|
|
||||||
- name: publish gitea release + assets
|
- name: publish gitea release + assets
|
||||||
|
shell: bash
|
||||||
env:
|
env:
|
||||||
# Auto-provided by Gitea Actions; has repo write (release) scope.
|
# Auto-provided by Gitea Actions; has repo write (release) scope.
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user