Skip to content

ci(release): auto-upload protocol tarball to GitHub Release - #3786

Merged
bokelley merged 1 commit into
mainfrom
bokelley/release-workflow-upload-tarball
May 1, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/release-workflow-upload-tarball

Conversation

@bokelley

@bokelley bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor

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

Tag `dist/protocol/X.Y.Z.tgz` in repo? GitHub Release assets
v3.0.0 yes 4 (manually uploaded by @bokelley on 2026-04-22)
v3.0.1 yes 0
v3.0.2 yes 0
v3.0.3 yes 0

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

  • name: Upload protocol tarball to GitHub Release
    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

  • CI green on this branch
  • After merge: next release on main (or 3.0.x) creates a v${VERSION} Release with all 4 assets attached
  • Backfill v3.0.1 / v3.0.2 / v3.0.3 release pages with their committed tarballs

Forward-merge considerations

  • This change applies to both lines (main and 3.0.x). After merge to main, will cherry-pick to 3.0.x — landing on main first per `.agents/playbook.md` § Release lines.
  • 3.0.x's next release (after the cherry-pick lands) would be the first to have automatic asset upload working from end to end.

🤖 Generated with Claude Code

`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]>
@bokelley
bokelley merged commit ba0fc50 into main May 1, 2026
13 checks passed
@bokelley
bokelley deleted the bokelley/release-workflow-upload-tarball branch May 1, 2026 21:31