Skip to content

Commit 645721c

Browse files
committed
fix(ci): move release and soak logic into canonical scripts
1 parent 0d85e02 commit 645721c

6 files changed

Lines changed: 78 additions & 46 deletions

File tree

‎.github/workflows/_soak.yml‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,12 @@ jobs:
4141
outputs:
4242
unix: ${{ steps.set.outputs.unix }}
4343
steps:
44+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4445
- name: Compute matrices
4546
id: set
4647
env:
4748
PLATFORMS: ${{ inputs.platforms }}
48-
run: |
49-
UNIX='[
50-
{"os":"ubuntu-latest","goos":"linux","goarch":"amd64","cc":"gcc","cxx":"g++"},
51-
{"os":"ubuntu-24.04-arm","goos":"linux","goarch":"arm64","cc":"gcc","cxx":"g++"},
52-
{"os":"macos-14","goos":"darwin","goarch":"arm64","cc":"cc","cxx":"c++"},
53-
{"os":"macos-15-intel","goos":"darwin","goarch":"amd64","cc":"cc","cxx":"c++"}
54-
]'
55-
case "$PLATFORMS" in
56-
all) ;;
57-
linux) UNIX=$(jq -c 'map(select(.goos == "linux"))' <<<"$UNIX") ;;
58-
*) echo "::error::unknown platforms input: $PLATFORMS"; exit 1 ;;
59-
esac
60-
echo "unix=$(jq -c '{include: .}' <<<"$UNIX")" >> "$GITHUB_OUTPUT"
49+
run: bash scripts/ci/soak-matrix.sh
6150

6251
soak-quick:
6352
needs: setup-matrix

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
runs-on: ubuntu-latest
7878
timeout-minutes: 5
7979
steps:
80+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8081
- name: Enforce v-prefixed semver version input
8182
env:
8283
VERSION: ${{ inputs.version }}
@@ -97,18 +98,7 @@ jobs:
9798
HOLD: ${{ inputs.hold_for_external_qualification }}
9899
REGISTRIES: ${{ inputs.publish_registries }}
99100
PRERELEASE_PUBLISH: ${{ inputs.publish_github_prerelease }}
100-
run: |
101-
fail() { echo "::error::$1"; exit 1; }
102-
if [ "$PRERELEASE_PUBLISH" = "true" ]; then
103-
[[ "$VERSION" == *-* ]] || fail "publish_github_prerelease requires a prerelease (hyphenated) version, got '$VERSION'"
104-
[ "$REGISTRIES" != "true" ] || fail "publish_github_prerelease cannot be combined with publish_registries"
105-
[ "$HOLD" != "true" ] || fail "publish_github_prerelease cannot be combined with hold_for_external_qualification"
106-
fi
107-
if [ "$PLATFORMS" = "linux" ]; then
108-
[ "$HOLD" != "true" ] || fail "platforms=linux has no Windows archive to qualify; set hold_for_external_qualification=false"
109-
[ "$REGISTRIES" != "true" ] || fail "platforms=linux cannot publish registry packages (they need every platform)"
110-
fi
111-
echo "input combination OK"
101+
run: bash scripts/ci/validate-release-inputs.sh
112102

113103
- name: Require exact-SHA Jenkins evidence when skipping tests
114104
if: ${{ inputs.skip_tests }}
@@ -246,19 +236,10 @@ jobs:
246236
247237
- name: List selected artifacts and decision evidence
248238
# nullglob: a linux-only release has no *.zip.
249-
run: |
250-
shopt -s nullglob
251-
ls -la *.tar.gz *.zip *.tsv
239+
run: bash scripts/ci/release-artifacts.sh list
252240

253241
- name: Generate checksums
254-
run: |
255-
shopt -s nullglob
256-
sha256sum \
257-
*.tar.gz *.zip \
258-
release-candidates.tsv \
259-
virustotal-candidate-results.tsv \
260-
release-selection.tsv \
261-
> checksums.txt
242+
run: bash scripts/ci/release-artifacts.sh checksums
262243

263244
- name: Attest checksum provenance
264245
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
@@ -280,16 +261,7 @@ jobs:
280261
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
281262

282263
- name: Sign artifacts
283-
run: |
284-
shopt -s nullglob
285-
for f in \
286-
*.tar.gz *.zip \
287-
release-candidates.tsv \
288-
virustotal-candidate-results.tsv \
289-
release-selection.tsv \
290-
checksums.txt; do
291-
cosign sign-blob --yes --bundle "${f}.bundle" "$f"
292-
done
264+
run: bash scripts/ci/release-artifacts.sh sign
293265

294266
- name: Refuse an existing immutable release identity
295267
env:

‎scripts/ci/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ CI and the local infrastructure — both of which the venue-parity contract
2020
| `select-release-candidates.py` | Apply the reviewed tuple-local VT truth table, or the explicit dry-run stripped default, and atomically copy one content-bound binary per target. | `_build.yml` |
2121
| `verify-release-selection.py` | Recompute the selection policy and prove every executable member in all 14 public containers equals its selected SHA-256. | `_build.yml`, `release.yml` final draft verification |
2222
| `check-virustotal.sh` | Poll and validate the exact candidate scan set, enforce engine coverage and the narrow documented Microsoft `!ml` policy, and emit content-bound results evidence. | `_build.yml` |
23+
| `validate-release-inputs.sh` | Reject unsafe release dispatch combinations. | `release.yml` preflight |
24+
| `release-artifacts.sh` | List, checksum, and sign staged release artifacts and selection evidence. | `release.yml` |
25+
| `soak-matrix.sh` | Select the Unix soak matrix for all platforms or Linux. | `_soak.yml` |

‎scripts/ci/release-artifacts.sh‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
# Run in the staged release directory; nullglob permits Linux-only archives.
4+
case "${1:-}" in
5+
-h|--help) echo 'Usage: bash scripts/ci/release-artifacts.sh list|checksums|sign'; exit 0 ;;
6+
list)
7+
shopt -s nullglob
8+
ls -la *.tar.gz *.zip *.tsv
9+
;;
10+
checksums)
11+
shopt -s nullglob
12+
sha256sum \
13+
*.tar.gz *.zip \
14+
release-candidates.tsv \
15+
virustotal-candidate-results.tsv \
16+
release-selection.tsv \
17+
> checksums.txt
18+
;;
19+
sign)
20+
shopt -s nullglob
21+
for f in \
22+
*.tar.gz *.zip \
23+
release-candidates.tsv \
24+
virustotal-candidate-results.tsv \
25+
release-selection.tsv \
26+
checksums.txt; do
27+
cosign sign-blob --yes --bundle "${f}.bundle" "$f"
28+
done
29+
;;
30+
*) echo 'Please consult --help.' >&2; exit 2 ;;
31+
esac

‎scripts/ci/soak-matrix.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
case "${1:-}" in
4+
-h|--help) echo 'Usage: PLATFORMS=all|linux GITHUB_OUTPUT=... bash scripts/ci/soak-matrix.sh'; exit 0 ;;
5+
'') ;;
6+
*) echo 'Please consult --help.' >&2; exit 2 ;;
7+
esac
8+
UNIX='[
9+
{"os":"ubuntu-latest","goos":"linux","goarch":"amd64","cc":"gcc","cxx":"g++"},
10+
{"os":"ubuntu-24.04-arm","goos":"linux","goarch":"arm64","cc":"gcc","cxx":"g++"},
11+
{"os":"macos-14","goos":"darwin","goarch":"arm64","cc":"cc","cxx":"c++"},
12+
{"os":"macos-15-intel","goos":"darwin","goarch":"amd64","cc":"cc","cxx":"c++"}
13+
]'
14+
case "$PLATFORMS" in
15+
all) ;;
16+
linux) UNIX=$(jq -c 'map(select(.goos == "linux"))' <<<"$UNIX") ;;
17+
*) echo "::error::unknown platforms input: $PLATFORMS"; exit 1 ;;
18+
esac
19+
echo "unix=$(jq -c '{include: .}' <<<"$UNIX")" >> "$GITHUB_OUTPUT"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
case "${1:-}" in
4+
-h|--help) echo 'Usage: VERSION=... PLATFORMS=... HOLD=... REGISTRIES=... PRERELEASE_PUBLISH=... bash scripts/ci/validate-release-inputs.sh'; exit 0 ;;
5+
'') ;;
6+
*) echo 'Please consult --help.' >&2; exit 2 ;;
7+
esac
8+
fail() { echo "::error::$1"; exit 1; }
9+
if [ "$PRERELEASE_PUBLISH" = "true" ]; then
10+
[[ "$VERSION" == *-* ]] || fail "publish_github_prerelease requires a prerelease (hyphenated) version, got '$VERSION'"
11+
[ "$REGISTRIES" != "true" ] || fail "publish_github_prerelease cannot be combined with publish_registries"
12+
[ "$HOLD" != "true" ] || fail "publish_github_prerelease cannot be combined with hold_for_external_qualification"
13+
fi
14+
if [ "$PLATFORMS" = "linux" ]; then
15+
[ "$HOLD" != "true" ] || fail "platforms=linux has no Windows archive to qualify; set hold_for_external_qualification=false"
16+
[ "$REGISTRIES" != "true" ] || fail "platforms=linux cannot publish registry packages (they need every platform)"
17+
fi
18+
echo "input combination OK"

0 commit comments

Comments
 (0)