Skip to content

Attach the deployed binary to the release page - #93

Merged
aterga merged 2 commits into
mainfrom
claude/publish-release-artifacts
Jul 28, 2026
Merged

aterga merged 2 commits into
mainfrom
claude/publish-release-artifacts

Conversation

@aterga

@aterga aterga commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A release-* tag deploys to production and leaves nothing behind. The only copy of the binary is a workflow artifact with 7-day retention, so the revision running in production stops being retrievable long before it stops running — and the tag's page (release-2026-07-28) carries notes but no assets.

Adds a publish job that uploads the binary and its SHA-256 to the Release, creating the Release if it doesn't exist.

Three constraints shaped it, each of which would be a bug if got wrong:

It needs: deploy, so an asset only appears once the rollout succeeded. An attached binary asserts this is what production is running; publishing one whose ship failed would make the Release page lie.

It runs only on the tag push (if: github.event_name == 'push'). A workflow_dispatch rollback re-deploys an existing tag whose Release already carries these assets, and github.ref_name on a dispatch is the branch, not the tag — so there would be no correct release to attach to.

It takes the commit from the reusable workflow, not github.sha. That required adding a workflow_call output to deploy-native.yml. On a rollback github.sha is the default branch while the deployed ref is something else — the same trap the build step already avoids, and it would have mislabelled precisely the release that most needs accurate provenance.

Related issues

None. Touches the same workflows as #84 and #81; #85 remains open on action pinning.

Changes

  • deploy-native.yml: expose sha as a workflow_call output, so callers can describe what was deployed without reaching for github.sha.
  • deploy-release.yml: add a publish job — downloads the artifact, renames imcp2 to imcp2-linux-arm64 (a bare imcp2 on a Release page doesn't say what platform it targets), writes a .sha256 alongside it, and publishes both.
  • Release notes are generated with the commit, the target platform, and a link to the run, plus a sha256sum -c line so the download is checkable. On a Release that already exists the assets are uploaded with --clobber and existing notes are left alone.
  • No new action dependencies: both the artifact download and the release upload go through gh, which ships on the runner. Pin setup-node, upload-artifact and download-artifact to commit SHAs in deploy-native.yml #85 already tracks three floating action references; this adds none.
  • permissions: on that job is contents: write + actions: read, and nothing else in the repo gains write access.

Two bugs found and fixed while addressing review (11847bc), both of which would only ever have surfaced on a real release cut:

  • The first revision used actions/download-artifact@v4 under permissions: {contents: write}. An explicit permissions: block replaces the default token scopes rather than adding to them, so the download had no Actions scope and would have 403'd. Switching to gh run download "$GITHUB_RUN_ID" removes the floating dependency and makes actions: read required for a reason that is visible in the file.
  • gh infers the repository from a checkout's git remote, and publish deliberately has no checkout — it needs an artifact and a tag, not a worktree. Every gh call would have failed on could not determine base repository. GH_REPO is now set at job level alongside GH_TOKEN.

Testing

  • All three workflows parse as YAML; deploy-native.yml exposes outputs.sha, and publish resolves to needs: deploy, if: github.event_name == 'push', permissions: {contents: write, actions: read}, env: {GH_TOKEN, GH_REPO}.
  • Confirmed the YAML block scalar strips indentation so the heredoc's EOF terminator lands at column 0 — an easy way to produce a script that parses as YAML and then fails at run time. bash -n on the extracted script passes.
  • Notes rendered with real values (TAG=release-2026-07-28, BUILT_SHA=80b8586, run 30300549759): tag, commit and run ID interpolate with backticks intact and the table renders.
  • Script exercised against a stubbed gh: dist/* expands to both the binary and the checksum; absent release takes the create branch and existing release takes upload --clobber, so a re-run repairs a partial upload instead of failing.
  • Not exercised end to end — publish only runs on a release-* tag push. The next release tag is the first real test, and neither fix above is verifiable before then.
  • Not run: cargo build / cargo test / clippy — no Rust source changed.
  • Not run: npm test --prefix monitoring/mcp-status — no dashboard code changed; the workflow runs it anyway.

Checklist

  • I have read the Contributing guidelines.
  • Docs (README / comments) updated for any user-visible change.
  • No secrets, credentials, or internal-only information are included.

The existing tag needs a one-off backfill

This cannot retroactively populate release-2026-07-28. That tag points at 80b8586, which predates the publish job, so re-running its workflow would use the old definition and publish nothing.

The Release itself already exists ("Initial release", created manually) with no assets — so this is an upload, not a create. The artifact from run 30370182090 is confirmed still live and expires 2026-08-04T14:53:33Z:

gh run download 30370182090 -R dfinity/imcp2 -n imcp2-binary -D dist
mv dist/imcp2 dist/imcp2-linux-arm64
( cd dist && sha256sum imcp2-linux-arm64 > imcp2-linux-arm64.sha256 )
gh release upload release-2026-07-28 -R dfinity/imcp2 \
  dist/imcp2-linux-arm64 dist/imcp2-linux-arm64.sha256

upload leaves the existing notes untouched. After 2026-08-04 the binary is gone from Actions and the release can only ever carry notes.


Generated by Claude Code

A release-* tag deployed to production and left nothing behind. The only copy
of the binary was a workflow artifact with 7-day retention, so the revision
running in production stopped being retrievable long before it stopped
running, and the tag's Release page was empty.

Add a publish job to deploy-release.yml that uploads the binary and its
sha256 to the Release, creating it if absent. Three constraints shaped it:

It needs deploy, so an asset only appears once the rollout succeeded. An
attached binary asserts "this is what production is running", which would be
false if ship had failed.

It runs only on the tag push. A workflow_dispatch rollback re-deploys a tag
whose Release already carries these assets, and github.ref_name on a dispatch
is the branch rather than the tag, so there would be no correct release to
attach to.

It takes the commit from the reusable workflow rather than github.sha, which
required adding a workflow_call output to deploy-native.yml. On a rollback
github.sha is the default branch while the deployed ref is not — the same trap
the build step already avoids, and it would have mislabelled exactly the
release that most needs accurate provenance.

Uses gh rather than a release action, since gh ships on the runner and the
repo has no pinned SHA for such an action. Idempotent, so a re-run repairs a
partial upload instead of failing. Verified against a stubbed gh that the
notes interpolate, the glob picks up both files, and the create and upload
branches each fire on the right condition.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R8ZshwKmjD5fZ4Hs9dS6zh
@aterga
aterga requested a review from Copilot July 28, 2026 16:19
@aterga
aterga marked this pull request as ready for review July 28, 2026 16:20
@aterga
aterga requested a review from a team as a code owner July 28, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a post-deploy publishing step to ensure production release-* tags retain a long-lived copy of the exact deployed binary (plus checksum) on the GitHub Release page, instead of relying on short-retention workflow artifacts.

Changes:

  • Exposes the built commit SHA from the reusable deploy-native.yml workflow via workflow_call outputs.
  • Adds a publish job to deploy-release.yml (gated on successful deploy + tag push) that downloads the deployed artifact, renames it with a platform suffix, generates a .sha256, and uploads both to the Release (creating it if needed).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/deploy-release.yml Adds a publish job to attach the deployed binary + checksum to the tag’s GitHub Release.
.github/workflows/deploy-native.yml Exposes the built commit SHA as a reusable-workflow output for callers to reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/deploy-release.yml Resolved
Comment thread .github/workflows/deploy-release.yml Resolved
The publish job set an explicit permissions: block, which replaces the
default token permissions wholesale rather than adding to them — so
contents: write alone left the artifact download without the actions: read
it needs, and it would have failed with a 403 on the first release cut
after this merged.

Fetch the artifact with `gh run download` scoped to $GITHUB_RUN_ID instead
of actions/download-artifact@v4. That settles the permissions question
(actions: read is now stated for a reason that is visible in the file) and
drops a third-party action pinned to a mutable major tag from a job that
already had the CLI it needed.

gh infers the repository from a checkout's git remote, and this job has
none, so GH_REPO is set at job level — otherwise every gh call here,
including the release upload that was already there, fails on "could not
determine base repository".

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R8ZshwKmjD5fZ4Hs9dS6zh
Copilot AI review requested due to automatic review settings July 28, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@aterga
aterga merged commit 84ecafc into main Jul 28, 2026
2 checks passed
aterga pushed a commit that referenced this pull request Jul 29, 2026
The release-2026-07-29 rollout succeeded but left no Release: `publish` was
SKIPPED (run 30441720101), and it turns out it could never have run at all —
it has been dead since it merged in #93.

`if: github.event_name == 'push'` carries no status check function, so GitHub
applies an implicit success() across the whole upstream chain. That chain
includes validate-ref, which is deliberately SKIPPED on a tag push, and a skip
is not a success — so the gate failed on the only path the job is restricted
to. The event half of the condition was true the whole time; the invisible half
was not.

This is precisely the trap the deploy job immediately above documents and works
around. I wrote that comment and then failed to carry the fix one job down.

Combine both halves so the status function suppresses the implicit success():

    if: ${{ !failure() && !cancelled() && github.event_name == 'push' }}

`needs: deploy` still holds, so a failed rollout stops the publish and an asset
never claims to be what production runs when it isn't.

Not fixable retroactively for release-2026-07-29: the tag points at 48f1ed6,
which predates this commit, so its workflow definition is the broken one. The
run's artifact is still in its window (expires 2026-08-05T10:02:35Z), so that
Release can be populated by hand — and unlike release-2026-07-28, no Release
object exists for it yet, so that is a create, not an upload.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R8ZshwKmjD5fZ4Hs9dS6zh
aterga added a commit that referenced this pull request Jul 29, 2026
The release-2026-07-29 rollout succeeded but left no Release: `publish` was
SKIPPED (run 30441720101), and it turns out it could never have run at all —
it has been dead since it merged in #93.

`if: github.event_name == 'push'` carries no status check function, so GitHub
applies an implicit success() across the whole upstream chain. That chain
includes validate-ref, which is deliberately SKIPPED on a tag push, and a skip
is not a success — so the gate failed on the only path the job is restricted
to. The event half of the condition was true the whole time; the invisible half
was not.

This is precisely the trap the deploy job immediately above documents and works
around. I wrote that comment and then failed to carry the fix one job down.

Combine both halves so the status function suppresses the implicit success():

    if: ${{ !failure() && !cancelled() && github.event_name == 'push' }}

`needs: deploy` still holds, so a failed rollout stops the publish and an asset
never claims to be what production runs when it isn't.

Not fixable retroactively for release-2026-07-29: the tag points at 48f1ed6,
which predates this commit, so its workflow definition is the broken one. The
run's artifact is still in its window (expires 2026-08-05T10:02:35Z), so that
Release can be populated by hand — and unlike release-2026-07-28, no Release
object exists for it yet, so that is a create, not an upload.


Claude-Session: https://claude.ai/code/session_01R8ZshwKmjD5fZ4Hs9dS6zh

Co-authored-by: Claude <[email protected]>
aterga pushed a commit that referenced this pull request Aug 3, 2026
Post-audit merges (#87-#115) that changed user-visible or documented
behavior, folded into the README:

- II's consent screen requires an explicit access-level choice (Questions
  only vs Actions & questions); it is not a read-only-by-default opt-out.
- Name the connect binding cookie correctly: mcp_connect, not sid, with
  Secure conditional on an https PUBLIC_URL.
- Document the official pages (/privacy-policy, /support, /terms) and the
  OpenAI domain-verification endpoint with its env-gated 404 behavior
  (#109, #112, #115).
- /version now reports the served II pairings via the instances array (#94).
- CWE-674: note the post-parse depth bounds on interface alias chains (#87)
  and the type-less reply decode/render path (#108).
- Companion-control note: percent-encoded slashes/dots in redirect paths are
  rejected (#107).
- Deploy: describe the reference native deployment pipeline (staging tracks
  main, release-* tags ship production with the binary attached) (#81, #93).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TGhwpdTbUqQbR5AiiN8Ljw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants