Skip to content

ci(release): attach the binaries as the Release is published - #250

Merged
flyq merged 2 commits into
mainfrom
liquan/ci/release-assets-at-publish
Nov 27, 2026
Merged

flyq merged 2 commits into
mainfrom
liquan/ci/release-assets-at-publish

Conversation

@flyq

@flyq flyq commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Published Releases in this repository are immutable, so on-release.yml can no longer attach files after publication.
v2.1.0 and v2.2.0 both failed with HTTP 422: Cannot upload assets to an immutable release and shipped without downloads.
This opts into the asset_files input added by megaeth-labs/.github#59, following megaeth-labs/mega-evm#425.

  • release-settle.yml: a new build job builds both binaries from the commit being published and checks their --version.
    It has contents: read only, with no environment, secrets or app token.
    publish needs it and passes the files to release-publish, which attaches them and SHA256SUMS before publishing.
    A failed build publishes nothing, and a re-run builds again before publish resumes.
  • The build job has no Actions cache access (cache-mode: none, and Foundry's own cache off).
    A versioned dispatch from main runs it in main's cache scope, so the routed commit's build scripts must not be able to write caches that later runs restore.
  • on-release.yml: the build and assets jobs are removed.
    registry downloads the binaries from the Release, verifies SHA256SUMS, and uploads them, so the Release page and the registry carry the same bytes.
  • This also fixes a second failure: on-release.yml kept its build artifact for 1 day, so a later approval fails at download-artifact: v2.1.0 failed that way, and the artifact of v2.2.0's first run expired while registry was still waiting.
    registry now reads from the Release, and the new artifact in release-settle.yml is kept 30 days to cover the wait for the reviewer.
  • The release-settle.yml dispatch input now reads "Version to settle", since a versioned dispatch can publish.

Differences from megaeth-labs/mega-evm#425

  • registry uploads the Release's own files instead of building them again, which that PR left as a follow-up.
    Older tags are unaffected: a release event or tag rehearsal runs the workflow from that tag's tree.
  • The asset names stay stateless-validator and debug-trace-server, as in v2.0.20 and earlier, without a target triple.

CodeQL

The actions/cache-poisoning/poisonable-step alert on the build step (#19) is dismissed as a false positive: the query does not model cache-mode.
mega-evm dismissed its equivalent alert the same way.

Notes

  • This takes effect for releases cut from main after the merge.
    v2.1.0 and v2.2.0 stay without downloads.
  • An on-release.yml rehearsal now needs a tag whose Release carries the binaries.

Testing

  • Both workflows parse; the job dependencies, route outputs, artifact name and asset paths were checked against each other.
  • The new download-and-checksum step was run locally against v2.0.20 (passes) and v2.2.0 (fails with no assets to download, as expected).
  • The same cargo build command and version checks passed on ubuntu-24.04 in both attempts of v2.2.0's On Release run.
  • The same publish pattern shipped mega-evm v1.7.4 with its assets from a dispatch on main, and its build log reads Cache mode: none.
  • app-token-lint passes in CI, and codespell and cargo fmt --all --check pass locally.
    Clippy and cargo sort were not run locally: no Rust or manifest changed.
  • actionlint was not run.
  • Not exercised end to end here: the publish path only runs on a real release.

🤖 Generated with Claude Code

Published Releases are immutable, so on-release.yml could no longer upload the
binaries afterwards: v2.1.0 and v2.2.0 both failed with "HTTP 422: Cannot
upload assets to an immutable release" and shipped without downloads.

release-settle now builds both binaries before publishing and hands them to
release-publish as asset_files. on-release downloads them from the Release for
the registry upload, so both carry the same bytes and a slow environment
approval no longer outlives a one-day workflow artifact.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@flyq
flyq requested a review from Troublor as a code owner November 27, 2026 02:40
@mega-maxwell

mega-maxwell Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Claude review status

Living comment — rewritten in place. The review workflow keeps this single comment up to date instead of posting a new one each round, so it always describes the latest reviewed commit and the earlier text is intentionally gone. No reply is needed here; reply to a finding in its own review thread, and answer an open question in a reply on this PR. The next review round reconciles your answer.

✅ Review clean

Last reviewed: 0e316c77..1d55db38 · updated 2026-11-27T03:31:45+00:00

New this round: 0 finding(s), 0 question(s) · Resolved this round: 0 · Open questions: 0

Comment thread .github/workflows/release-settle.yml Dismissed
@flyq flyq closed this Nov 27, 2026
@flyq
flyq deleted the liquan/ci/release-assets-at-publish branch November 27, 2026 03:19
@flyq
flyq restored the liquan/ci/release-assets-at-publish branch November 27, 2026 03:24
@flyq flyq reopened this Nov 27, 2026
A versioned dispatch from main runs the build job in main's cache scope while it
compiles the routed commit, which CodeQL reports as cache poisoning. Set
cache-mode: none on the job and turn Foundry's cache off, as
megaeth-labs/mega-evm#425 does, so that commit's build scripts cannot write
caches that later runs restore.

Also say in the dispatch input that a version settles, not only refreshes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@flyq
flyq merged commit bf0b830 into main Nov 27, 2026
23 checks passed
@flyq
flyq deleted the liquan/ci/release-assets-at-publish branch November 27, 2026 07:10
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.

4 participants