Repository navigation
ci(release): auto-upload protocol tarball to GitHub Release - #3786
Merged
Merged
Conversation
`createGithubReleases: true` from changesets/action only writes the
changelog body — files have to be uploaded separately. Without this
step the artifacts ship to the repo's dist/ tree but are never attached
as Release assets, leaving adopters who pin via release URL with 404s.
v3.0.0 had assets only because they were uploaded by hand on 2026-04-22;
v3.0.1 / v3.0.2 / v3.0.3 all shipped empty.
New step runs after changesets/action, gated on
`steps.changesets.outputs.published == 'true'` so it only fires on
tag-and-release runs (not Version Packages PR-creation runs). Uploads
${VERSION}.tgz plus .sha256 / .sig / .crt sidecars with --clobber so
re-runs are idempotent.
Backfill of the three missing releases (v3.0.1 / v3.0.2 / v3.0.3) is a
separate manual step against the assets already committed at
dist/protocol/ on the 3.0.x branch.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2 tasks
Summary
`changesets/action@v1`'s `createGithubReleases: true` only writes the changelog body — files aren't attached automatically. The release pipeline produces `dist/protocol/${VERSION}.tgz` (plus `.sha256`, `.sig`, `.crt` sidecars from the cosign signing step) and commits them to the repo's `dist/` tree, but no step uploads them as Release assets.
Symptom
Adopters who pin via the release URL (`gh release download v3.0.3 -p '*.tgz'` or fetching the asset URL programmatically) hit 404 for three consecutive releases. The cosign signature lives next to the tarball in `dist/` but consumers can't access either through the standard Release distribution channel.
Fix
Adds a `Upload protocol tarball to GitHub Release` step after `changesets/action`, gated on `steps.changesets.outputs.published == 'true'` so it only fires on tag-and-release runs, not Version Packages PR-creation runs. Uses `gh release upload --clobber` so retried runs don't error on existing assets.
```yaml
if: steps.changesets.outputs.published == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -euo pipefail
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
TARBALL="dist/protocol/${VERSION}.tgz"
if [ ! -f "${TARBALL}" ]; then
echo "::error::Tarball not found at ${TARBALL}. Did npm run version fail upstream?"
exit 1
fi
gh release upload "${TAG}" \
"${TARBALL}" \
"${TARBALL}.sha256" \
"${TARBALL}.sig" \
"${TARBALL}.crt" \
--clobber
```
The token is the `aao-release-bot[bot]` GitHub App installation token already minted earlier in the job (used by checkout and by changesets/action) — same identity that creates the Release entry, so the upload is logically part of the same release operation.
Backfill
The three missing releases (v3.0.1 / v3.0.2 / v3.0.3) have their tarballs committed at `dist/protocol/` on the 3.0.x branch already. I'll backfill them via `gh release upload` from the local checkout once this PR merges (or before — they're idempotent against `--clobber`). Tracked separately so this PR is small.
Test plan
Forward-merge considerations
🤖 Generated with Claude Code