Skip to content

ci: attach mega-evme to the release at publication - #425

Merged
RealiCZ merged 7 commits into
mainfrom
cz/ci/attach-mega-evme-to-release
Nov 24, 2026
Merged

RealiCZ merged 7 commits into
mainfrom
cz/ci/attach-mega-evme-to-release

Conversation

@RealiCZ

@RealiCZ RealiCZ commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Releases here are immutable once published. on-release.yml runs after publishing, so it cannot attach assets; #424 removed that step for this reason. megaeth-labs/.github#59 (merged) adds an asset_files input to release-publish, which attaches files to the draft before the Release is published. This PR opts mega-evm in.

  • release-settle.yml
    • New build job:
      • runs only when the route says publish;
      • has contents: read and no environment, secrets or app token;
      • has no Actions cache access (cache-mode: none, and Foundry's own cache off). A versioned dispatch from main runs this job in main's cache scope, so the routed commit's build scripts must not be able to write caches that later runs restore;
      • checks out the routed commit with submodules and builds mega-evme with --locked;
      • checks mega-evme --version against the release version;
      • stages it as mega-evme-x86_64-unknown-linux-gnu and 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.
    • publish now needs build, downloads the artifact and passes release-files/mega-evme-x86_64-unknown-linux-gnu as asset_files. release-publish adds SHA256SUMS itself.
    • If the build fails, publish does not run, so no tag is created.
    • Foundry and the submodules stay in this build and in on-release.yml: release lines cut before chore(system-contracts): make the build read-only and attest bytecode in CI #429 still run forge in build.rs.
    • The dispatch input now reads "Version to settle": a versioned dispatch can publish a clean release branch, not only refresh it.
  • 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 own mega-evme name and still builds from the tag; reusing the Release file there is a follow-up.
  • bump-version-release skill: rewritten to match the current flow: publishing without a settle PR when the branch is clean, approving the release deployment, 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-gnu link.

Test plan

  • release-settle.yml checked structurally against main:
    • route and refresh are unchanged;
    • publish differs only by needs, the download step and asset_files;
    • build has 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.
  • actionlint and app-token-lint pass on both workflows. The one exception: actionlint 1.7.12 does not know the job-level cache-mode key yet and reports it as unexpected. CI does not run actionlint.
  • Since the first review head, release-settle.yml changed only by cache-mode: none on build, cache: false on its Foundry step, the asset name, the dispatch input description and comments; on-release.yml only by the checkout ref, Foundry's cache input and comments.
  • The asset_files path 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-evme from a recursive clone of main builds and reports mega-evme 1.7.3.
  • The next release publishes with mega-evme-x86_64-unknown-linux-gnu and SHA256SUMS attached.

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: spec:unchanged
  • comp: comp:misc
  • api: api:unchanged

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.
@RealiCZ RealiCZ added spec:unchanged No change to any `mega-evm`'s behavior comp:misc Changes to the miscellaneous part of this repo api:unchanged No change to the public interface or API labels Nov 20, 2026
@mega-maxwell

mega-maxwell Bot commented Nov 20, 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: 14510544..6c286cbf · updated 2026-11-24T04:00:36+00:00

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

@github-actions

Copy link
Copy Markdown

🧬 Mutation testing

No results at target/mutants/mutants.out — nothing was mutated (e.g. no mutatable changes).

Comment thread .github/workflows/release-settle.yml Dismissed
@github-actions

Copy link
Copy Markdown

🧬 Spec-gate mutation — ✅ PASS

Nothing 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.
@RealiCZ
RealiCZ marked this pull request as ready for review November 24, 2026 03:12

@flyq flyq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/release-settle.yml Outdated
version_pattern: toml
changelog_file: CHANGELOG.md
asset_files: |
release-files/mega-evme

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0bcbd4e: step 3 now says the binary is built and its version checked first, and names the attached files. 32e42ee adds that if the build fails, publish does not run and no tag is created.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.
@RealiCZ
RealiCZ requested a review from flyq November 24, 2026 04:09

@flyq flyq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@RealiCZ
RealiCZ merged commit e4982a7 into main Nov 24, 2026
30 checks passed
@RealiCZ
RealiCZ deleted the cz/ci/attach-mega-evme-to-release branch November 24, 2026 04:32
flyq added a commit to megaeth-labs/stateless-validator that referenced this pull request 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:unchanged No change to the public interface or API comp:misc Changes to the miscellaneous part of this repo spec:unchanged No change to any `mega-evm`'s behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants