Skip to content

Commit 4128f18

Browse files
authored
ci: add artifact strategy guard (.deb/.rpm/tarball forbidden) (#107)
Reciprocal CI check for #106 — fails the build if .deb/.rpm/tarball packaging tooling reappears in Cargo.toml or release.yml. Release deliverable is the bare static-musl binary only. Validated: - Guard passes on current main (post-#105 cleanup) - Guard fails when [package.metadata.deb] is reintroduced Fixes #106
1 parent c73de9a commit 4128f18

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,50 @@ jobs:
5757
fi
5858
echo "OK: All dependencies are from crates.io or local paths — build is fully self-contained."
5959
60+
artifact-strategy-guard:
61+
name: Artifact Strategy Guard
62+
runs-on: [self-hosted, Linux]
63+
timeout-minutes: 2
64+
steps:
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
66+
with:
67+
persist-credentials: false
68+
- name: Forbid .deb / .rpm / tarball packaging
69+
# Release artifact policy (issue #106): the only release deliverable is
70+
# the bare static-musl binary `pki-${VERSION}-linux-x86_64-musl`.
71+
# No .deb, no .rpm, no tar.gz wrapper. This guard fails the build if
72+
# the forbidden patterns reappear (cargo-deb / cargo-generate-rpm
73+
# metadata, packaging tooling in release.yml, or non-musl assets in
74+
# the release upload glob).
75+
run: |
76+
set -euo pipefail
77+
fail=0
78+
msg() { echo "::error::$1"; fail=1; }
79+
80+
# 1. No cargo-deb / cargo-generate-rpm metadata in any Cargo.toml.
81+
if grep -RIn --include='Cargo.toml' -E '^\[package\.metadata\.(deb|generate-rpm)\]' . ; then
82+
msg "Forbidden [package.metadata.deb] or [package.metadata.generate-rpm] block found. Release artifact is bare musl binary only — no .deb or .rpm."
83+
fi
84+
85+
# 2. No cargo-deb / cargo-generate-rpm tooling in release.yml.
86+
if grep -nE '(cargo[- ]deb|cargo[- ]generate[- ]rpm)' .github/workflows/release.yml ; then
87+
msg "Forbidden cargo-deb / cargo-generate-rpm reference in .github/workflows/release.yml."
88+
fi
89+
90+
# 3. No .deb / .rpm / .tar.gz / .zip in the release upload step.
91+
# The release workflow's gh release create line is the source of truth.
92+
if grep -nE 'gh release create.*\.(deb|rpm|tar\.gz|tgz|zip)' .github/workflows/release.yml ; then
93+
msg "Forbidden non-musl asset (.deb/.rpm/.tar.gz/.tgz/.zip) in release upload."
94+
fi
95+
96+
if [[ "$fail" -ne 0 ]]; then
97+
echo ""
98+
echo "Release artifact policy: only pki-\${VERSION}-linux-x86_64-musl is shipped."
99+
echo "See: https://github.com/rayketcham-lab/PKI-Client/issues/106"
100+
exit 1
101+
fi
102+
echo "OK: release artifact strategy is bare musl binary only."
103+
60104
vendor-check:
61105
name: Vendor Freshness
62106
runs-on: [self-hosted, Linux]

0 commit comments

Comments
 (0)