Repository navigation
ci: attach mega-evme to the release at publication - #425
Conversation
release-settle.yml now builds mega-evme in a credential-free job and passes it to release-publish as asset_files. Releases are immutable once published, so the binary must be attached before publication.
Claude review status
✅ Review clean Last reviewed: New this round: 0 finding(s), 0 question(s) · Resolved this round: 0 · Open questions: 0 |
🧬 Mutation testingNo results at |
🧬 Spec-gate mutation — ✅ PASSNothing to test — no mutants were generated on the changed lines. |
The build job checks out the routed commit while holding the dispatching branch's cache scope. Denying it all cache access keeps that commit's build scripts from writing caches that later runs restore.
flyq
left a comment
There was a problem hiding this comment.
Review findings: 1 important, 5 nits (inline below).
The one to settle before merging is the job-level cache-mode: none key on build: nothing shows that GitHub accepts it, and if it doesn't, the whole Release Settle workflow stops starting.
| # cache access and the routed commit's build scripts cannot write caches that later runs restore. | ||
| build: | ||
| needs: route | ||
| cache-mode: none |
There was a problem hiding this comment.
Important: GitHub may not accept job-level cache-mode.
The PR notes say actionlint 1.7.12 reports this key as unexpected, and no other megaeth-labs workflow uses it, so nothing shows that GitHub accepts it. If it doesn't, the whole workflow file is invalid and Release Settle stops starting: no refresh and no publish.
Failure scenario: this merges, a new release-v* branch is cut, and every push to it fails with "Invalid workflow file: Unexpected value cache-mode". The settle PR never opens, the release can't be tagged, and this file has to be fixed before any release can go out.
Suggested fix: run the workflow from a branch, or validate the file against GitHub's live schema, before merging. If the key isn't supported, drop it and isolate the cache another way.
There was a problem hiding this comment.
GitHub accepts it. jobs.<job_id>.cache-mode is part of the workflow syntax reference (source, section jobs.<job_id>.cache-mode, available on GitHub.com). none denies both restore and save, and the cache service enforces it through the job's scoped cache token.
It also works in practice on an ordinary runs-on job. inkeep/open-knowledge sets cache-mode: none on one (bug-lane.yml#L109), and run 37666795584 at that commit completed that job successfully.
actionlint 1.7.12 was released before the key existed, which is why it flags it. CI here does not run actionlint.
| # published, and this workflow runs only after publishing, so attaching the | ||
| # binary to the Release fails (HTTP 422). The binary goes to the registry | ||
| # only until the release pipeline attaches assets before it publishes. | ||
| # `release-settle.yml` builds mega-evme and `release-publish` attaches it with |
There was a problem hiding this comment.
Nit: the Release and the registry get two different builds.
The Release asset and its SHA256SUMS now come from the build job in release-settle.yml, while on-release.yml still builds mega-evme again from the tag, with Foundry's cache on. The registry copy isn't covered by the published SHA256SUMS and may differ byte for byte, so users can't check one copy against the other.
Suggested fix: have on-release.yml download the Release's mega-evme, verify it against SHA256SUMS, and upload that file instead of building it again.
There was a problem hiding this comment.
Agreed that reusing the Release file is the better end state: download it with SHA256SUMS, verify it, and upload those bytes. That needs a path for older tags that carry no assets, so I'd do it as a follow-up once the first Release with the asset is out.
In this PR, 32e42ee turns off Foundry's cache in that job, and the release guide now says the registry copy is built separately.
| version_pattern: toml | ||
| changelog_file: CHANGELOG.md | ||
| asset_files: | | ||
| release-files/mega-evme |
There was a problem hiding this comment.
Nit: the asset name has no platform in it.
Plain mega-evme is a Linux x86_64 glibc binary built on ubuntu-24.04 (glibc 2.39). Releases are immutable, so the name is permanent, and a releases/latest/download/mega-evme link would hand it to macOS users and users of older distros (exec format error / GLIBC_2.39 not found) with no warning in the file name.
Suggested fix: rename it before upload, e.g. mega-evme-x86_64-unknown-linux-gnu, while no Release carries the old name yet.
There was a problem hiding this comment.
Good point. Changed in 32e42ee: the asset is now mega-evme-x86_64-unknown-linux-gnu. It is still a bare binary, with no version in the name, so a releases/latest/download/... link stays stable. The registry upload keeps its own name.
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| needs: [route, build] |
There was a problem hiding this comment.
Nit: retrying a finished release now needs a full rebuild first.
publish needs build, yet release-publish says a finished retry exits 0 and "must not need the files to still be on disk". If a publish run dies after the tag is pushed and the re-run's build fails on a transient crates.io or Foundry download error, publish is skipped and the Release stays unpublished until the ~40-minute build passes, even though resuming needs nothing but the same files.
Suggested fix: accept and document this as intended, or let build skip when the Release for the tag already exists.
There was a problem hiding this comment.
Accepting this as intended. A rerun rebuilds before publish resumes, and the release guide now says so (32e42ee). Skipping the build when the Release already exists would add another routing branch for a rare case.
| 4. **Targets** — automatic on the Release: `on-release.yml` uploads `mega-evme` to the MegaETH artifact registry, in the `release` environment. | ||
| crates.io publishing is paused while the OP crates are git-pinned (see the root `Cargo.toml`), so no crates are published. | ||
| Release assets are paused: Releases are immutable once published, so `on-release.yml` attaches nothing to them. | ||
| Publishing attaches `mega-evme` and `SHA256SUMS` to the Release through `release-settle.yml` and `release-publish`'s `asset_files`. |
There was a problem hiding this comment.
Nit: this note is under the wrong step.
It sits under step 4 ("Targets — automatic on the Release"), but the files are attached in step 3 (Publish), before the Release exists. Step 3 also doesn't mention that a credential-free build now runs first and that a failed build means no tag is created. A release manager looking for missing assets would check on-release.yml instead of the build/publish jobs of release-settle.yml.
Suggested fix: move this sentence into step 3 and mention the build job and how it fails there.
| RELEASE_BRANCH: ${{ needs.route.outputs.release_branch }} | ||
| run: echo "version=${RELEASE_BRANCH#release-v}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - uses: megaeth-labs/.github/.github/actions/release-verify-version@main |
There was a problem hiding this comment.
Nit: this action isn't pinned to a commit SHA.
release-verify-version@main is a moving branch ref. The PR test plan says every action in build is pinned to a commit SHA, which isn't true for this step. A change pushed to megaeth-labs/.github main could alter the version check that guards the attached binary without a review here.
Suggested fix: pin it to a commit SHA, or correct the test plan to say org actions follow @main on purpose, as the existing jobs do.
There was a problem hiding this comment.
That is intended. The megaeth-labs/.github actions follow @main here, as they do in the existing route, refresh and publish jobs. The test plan line was wrong: it now says third-party actions are pinned to a commit SHA and org actions follow @main.
The registry job now checks out the run's commit instead of the tag name, which a same-named branch could shadow. The release guide now covers publishing without a settle PR, the approval step, recovery, hotfixes and labels.
Release assets are permanent, so the binary file name carries its target triple. The registry job also stops using the Foundry cache.
…m/megaeth-labs/mega-evm into cz/ci/attach-mega-evme-to-release
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>
Summary
Releases here are immutable once published.
on-release.ymlruns after publishing, so it cannot attach assets; #424 removed that step for this reason. megaeth-labs/.github#59 (merged) adds anasset_filesinput torelease-publish, which attaches files to the draft before the Release is published. This PR opts mega-evm in.release-settle.ymlbuildjob:publish;contents: readand no environment, secrets or app token;cache-mode: none, and Foundry's own cache off). A versioned dispatch frommainruns this job inmain's cache scope, so the routed commit's build scripts must not be able to write caches that later runs restore;mega-evmewith--locked;mega-evme --versionagainst the release version;mega-evme-x86_64-unknown-linux-gnuand uploads that as a workflow artifact. Release assets are permanent, so the name carries the target triple; it is a bare binary with no version in the name.publishnow needsbuild, downloads the artifact and passesrelease-files/mega-evme-x86_64-unknown-linux-gnuasasset_files.release-publishaddsSHA256SUMSitself.publishdoes not run, so no tag is created.on-release.yml: release lines cut before chore(system-contracts): make the build read-only and attest bytecode in CI #429 still run forge inbuild.rs.on-release.yml: checks out the run's commit (github.sha) instead of the tag name, which a branch of the same name would shadow, and turns off Foundry's cache. The registry upload keeps its ownmega-evmename and still builds from the tag; reusing the Release file there is a follow-up.bump-version-releaseskill: rewritten to match the current flow: publishing without a settle PR when the branch is clean, approving thereleasedeployment, recovery, hotfixes and labels.The README "Prebuilt binary" sections stay out until a published release actually carries the binary. A follow-up will add them back, with a
releases/latest/download/mega-evme-x86_64-unknown-linux-gnulink.Test plan
release-settle.ymlchecked structurally againstmain:routeandrefreshare unchanged;publishdiffers only byneeds, the download step andasset_files;buildhas no credentials; every third-party action is pinned to a commit SHA, and the megaeth-labs/.github actions follow@main, as in the existing jobs.actionlintandapp-token-lintpass on both workflows. The one exception: actionlint 1.7.12 does not know the job-levelcache-modekey yet and reports it as unexpected. CI does not run actionlint.release-settle.ymlchanged only bycache-mode: noneonbuild,cache: falseon its Foundry step, the asset name, the dispatch input description and comments;on-release.ymlonly by the checkout ref, Foundry's cache input and comments.asset_filespath was rehearsed on real GitHub with immutable releases enabled. Results are in feat(release): attach assets before publication .github#59.cargo build --release --locked -p mega-evmefrom a recursive clone ofmainbuilds and reportsmega-evme 1.7.3.mega-evme-x86_64-unknown-linux-gnuandSHA256SUMSattached.CodeQL's cache-poisoning query does not model
cache-mode, so its alert on the build step may stay open after this change. If it does, it will be dismissed with that reason.Labels checklist
spec:unchangedcomp:miscapi:unchanged