Skip to content

Commit cf90f22

Browse files
author
matthew
committed
release: guard against phantom (0-asset) releases
Add a verify-assets job that fails the release run if the published Release carries zero assets, so a build/pack failure across every target can never surface as a real release (or notify downstream) unnoticed. Wire it after the build matrix; downstream notify now needs it too.
1 parent 9838376 commit cf90f22

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,44 @@ jobs:
167167
with:
168168
subject-path: "plugin-dist/*.tar.gz"
169169

170+
# PHANTOM-RELEASE GUARD: assert the published Release actually carries assets before we treat this
171+
# as a real release. The per-target build/upload jobs run with fail-fast:false, and `create-release`
172+
# always makes the (initially empty) Release up front — so a build/pack failure on EVERY target
173+
# (e.g. a stale Cargo.lock tripping `--locked`) leaves a tag + Release with ZERO assets: a "phantom"
174+
# that silently breaks busbar's plugin-registry-gate. This job fails the whole release run loud if
175+
# assets == 0, so a phantom can never ship (or notify downstream) unnoticed. It depends on the build
176+
# matrix but does NOT inherit its fail-fast:false — one green target is enough to have assets, but
177+
# zero across the board must hard-fail here.
178+
verify-assets:
179+
needs: [auth-plugin]
180+
runs-on: ubuntu-latest
181+
steps:
182+
- name: Assert the Release has at least one asset
183+
env:
184+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185+
run: |
186+
set -euo pipefail
187+
count="$(gh release view "${GITHUB_REF_NAME}" \
188+
--repo "${GITHUB_REPOSITORY}" \
189+
--json assets --jq '.assets | length')"
190+
echo "Release ${GITHUB_REF_NAME} has ${count} asset(s)."
191+
if [ "${count}" -eq 0 ]; then
192+
echo "::error::PHANTOM RELEASE: ${GITHUB_REF_NAME} was published with 0 assets." \
193+
"Every build/pack target failed to upload a tarball. Failing the release run so this" \
194+
"tag is not mistaken for a real release by busbar's plugin-registry-gate. Fix the" \
195+
"build (check Cargo.lock freshness vs --locked and the plugin cdylib build step)," \
196+
"delete this tag+release, and re-cut." >&2
197+
exit 1
198+
fi
199+
170200
# Instant marketing-site rebuild the moment this plugin ships a real release -- marketing's
171201
# deploy.yml listens for this exact repository_dispatch event type (plus its own daily-poll
172202
# fallback, so a missed/failed dispatch here is never a permanent gap). Same RELEASE_DISPATCH_TOKEN
173203
# pattern busbar core's own release.yml uses for its downstream fan-out -- see that file's
174204
# notify-downstream job for the template this mirrors. Fails loud (not a silent no-op) if the
175205
# secret isn't provisioned, so a missing secret can't masquerade as "nothing to notify."
176206
notify-marketing:
177-
needs: [auth-plugin]
207+
needs: [auth-plugin, verify-assets]
178208
runs-on: ubuntu-latest
179209
steps:
180210
- name: Dispatch upstream-release to the marketing site

0 commit comments

Comments
 (0)