Repository navigation
ci: publish the Maple crates to crates.io from a reviewed tag - #1
Conversation
maple-sdk must stay publishable to crates.io, which refuses a crate with a Git dependency, so the two crates this fork changes have to be published under Maple's names. `maple-publish.yml` runs for a tag `maple-v<version>`. Its script refuses unless the tagged commit is the head of a `maple/<release>-publish` branch that is exactly one commit on top of `maple/<release>`, and the two manifests carry the tagged version and pin every workspace sibling exactly. It then runs the workspace tests and a dry run without a credential. The upload is a second job behind the `maple-crates` environment. It repeats the check, uploads `maple-sigstore-rekor`, waits until the crates.io index serves it, and uploads `maple-sigstore-verify`. A crate the index already serves at that version is skipped, so a rerun finishes a half-done release and does nothing when both are there. A crate's first version uses a bootstrap token from the environment, because crates.io offers trusted publishing only for a crate that already exists; later versions use trusted publishing. Nothing names a release line, so the same files serve the next `maple/<release>`. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
w3irdrobot
left a comment
There was a problem hiding this comment.
Looks good. Ran the 32 script tests locally and read through the partial-failure and rerun paths; no problems found.
One thing worth adding on the repo side, not in this PR: a tag ruleset limiting who can create maple-v* tags. The branch and manifest checks run from the script at the tagged commit, so a tag on a commit with an edited script would skip them. The reviewer gate in maple-crates still stands in the way, but restricting tag creation closes it properly.
The red Test (windows-latest) is not from this change: test-vectors/ isn't marked binary in .gitattributes, so Windows checks the artifacts out with CRLF and the conformance hashes stop matching. I'll send a one-line fix after this merges, then rebuild maple/0.17-publish on the new head.
(Reviewed with AI assistance.)
Co-Authored-By: Claude <noreply@anthropic.com>
|
Merged as
|
|
We didn't wait for the line-ending fix, since it changes nothing that ships in the crates. I rebuilt |
|
Both crates are on crates.io.
You can switch Maple PR 1672 to the published crates. |
Adds the workflow that publishes
maple-sigstore-rekorandmaple-sigstore-verifyto crates.io, behind a reviewer gate. Nothing has been published and no tag exists yet.How it works
maple-v<version>, for examplemaple-v0.17.0-maple.1. The workflow file lives on the Maple branches and never onmain.checkjob, no credential: the script refuses unless the tagged commit is the head of amaple/<release>-publishbranch read from the remote, its only parent is the head ofmaple/<release>, and both manifests carry the tagged version and pin every workspace sibling exactly. Then it runscargo test --all-features --workspace --lockedand onecargo publish --dry-runfor the crates not yet published.publishjob, inmaple-crates: repeats the check, uploadsmaple-sigstore-rekor, polls the crates.io index until it serves that version, then uploadsmaple-sigstore-verify. Uploads use--no-verify, so no dependency build script runs beside the credential; thecheckjob already built this commit.0.17. The rebase inMAPLE.mdcarries these files to the nextmaple/<release>.Credentials
crates.io's documentation says a crate must already exist before trusted publishing can be configured, so:
CRATES_BOOTSTRAP_TOKENfrom themaple-cratesenvironment;rust-lang/crates-io-auth-action, pinned to the same commit upstream and the Maple repository use.The workflow chooses from what the index serves.
Already set up
maple-crates: required reviewer AnthonyRonning, no admin bypass, limited to tagsmaple-v*. It holds no secret yet.crates-io: the environment upstream'srelease-plz.ymlasks for, created here with no allowed branch or tag, so that job cannot start in this fork.Upstream's inherited workflows
release-plz.ymlruns on a push tomainin an environment namedcrates-ioand asks crates.io for a trusted-publishing token. It cannot publish from here: this repository has no secrets, upstream's crates trust only upstream's repository, and the Maple crates will trust onlymaple-publish.ymlinmaple-crates. The lockedcrates-ioenvironment is a second guard. GitHub registersrelease-plz.ymlonly after a push tomainruns it, so it cannot be disabled yet;MAPLE.mdsays to disable it when it appears.Actions is already on in this fork: opening this pull request started upstream's
pull_requestworkflows (CI, interop, TUF conformance, zizmor).Checked
planagainst the real repository and index with Cargo 1.99.0: accepts9e57a2bas the head ofmaple/0.17-publishand reports both crates to publish with the bootstrap token. It refuses a tag on themaple/0.17head, a wrong build number, a tag for another upstream release, and the frozen 0.16 publish branch.--no-verify.actionlintandzizmorreport nothing.Not checked
maple-publish.ymlhas never run: the first tag is its first run. Nothing is uploaded until thepublishjob is approved.After this merges
maple/0.17-publishas the rename commit on the newmaple/0.17head. Its head changes from9e57a2b.CRATES_BOOTSTRAP_TOKENtomaple-crates: scoped to publishing new crates namedmaple-sigstore-*, short expiry.maple-v0.17.0-maple.1at the publish branch head and approve thepublishjob.🤖 Generated with Claude Code