Skip to content

ci: publish the Maple crates to crates.io from a reviewed tag - #1

Merged
AnthonyRonning merged 3 commits into
maple/0.17from
ci/maple-publish-workflow
Nov 25, 2026
Merged

AnthonyRonning merged 3 commits into
maple/0.17from
ci/maple-publish-workflow

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 25, 2026 •

Copy link
Copy Markdown

Adds the workflow that publishes maple-sigstore-rekor and maple-sigstore-verify to crates.io, behind a reviewer gate. Nothing has been published and no tag exists yet.

How it works

  • Trigger: a tag maple-v<version>, for example maple-v0.17.0-maple.1. The workflow file lives on the Maple branches and never on main.
  • check job, no credential: the script refuses unless the tagged commit is the head of a maple/<release>-publish branch read from the remote, its only parent is the head of maple/<release>, and both manifests carry the tagged version and pin every workspace sibling exactly. Then it runs cargo test --all-features --workspace --locked and one cargo publish --dry-run for the crates not yet published.
  • publish job, in maple-crates: repeats the check, uploads maple-sigstore-rekor, polls the crates.io index until it serves that version, then uploads maple-sigstore-verify. Uploads use --no-verify, so no dependency build script runs beside the credential; the check job already built this commit.
  • Reruns: a crate the index already serves at this version is skipped. When both are there, the run says so and asks for no approval.
  • Release line: nothing names 0.17. The rebase in MAPLE.md carries these files to the next maple/<release>.

Credentials

crates.io's documentation says a crate must already exist before trusted publishing can be configured, so:

  • a crate's first version uses CRATES_BOOTSTRAP_TOKEN from the maple-crates environment;
  • later versions use trusted publishing through 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 tags maple-v*. It holds no secret yet.
  • crates-io: the environment upstream's release-plz.yml asks for, created here with no allowed branch or tag, so that job cannot start in this fork.

Upstream's inherited workflows

release-plz.yml runs on a push to main in an environment named crates-io and 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 only maple-publish.yml in maple-crates. The locked crates-io environment is a second guard. GitHub registers release-plz.yml only after a push to main runs it, so it cannot be disabled yet; MAPLE.md says to disable it when it appears.

Actions is already on in this fork: opening this pull request started upstream's pull_request workflows (CI, interop, TUF conformance, zizmor).

Checked

  • 32 script tests pass, covering the commit rules, the manifest rules, the registry states and the upload order.
  • plan against the real repository and index with Cargo 1.99.0: accepts 9e57a2b as the head of maple/0.17-publish and reports both crates to publish with the bootstrap token. It refuses a tag on the maple/0.17 head, a wrong build number, a tag for another upstream release, and the frozen 0.16 publish branch.
  • Cargo 1.99.0 on a two-crate stand-in workspace: the two-crate dry run passes, and the second crate cannot be packaged alone until the first is in the index, with or without --no-verify.
  • actionlint and zizmor report nothing.

Not checked

  • maple-publish.yml has never run: the first tag is its first run. Nothing is uploaded until the publish job is approved.
  • The workspace tests and the real dry run were not run here.
  • A real upload, the bootstrap token, and trusted publishing.

After this merges

  1. Rebuild maple/0.17-publish as the rename commit on the new maple/0.17 head. Its head changes from 9e57a2b.
  2. Add CRATES_BOOTSTRAP_TOKEN to maple-crates: scoped to publishing new crates named maple-sigstore-*, short expiry.
  3. Push maple-v0.17.0-maple.1 at the publish branch head and approve the publish job.
  4. Delete the secret, revoke the token, and add a trusted-publisher entry to each crate.

🤖 Generated with Claude Code

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 w3irdrobot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>
@AnthonyRonning
AnthonyRonning merged commit 57ddac5 into maple/0.17 Nov 25, 2026
14 of 15 checks passed
@AnthonyRonning

Copy link
Copy Markdown
Author

Merged as 57ddac5. Two things changed after your review:

  • Tag rule added, as you suggested. Only organization admins can create, move or delete maple-v* tags, the same shape as Maple's own release-tag rule. You're an org member, so we push the release tag: send the head of maple/0.17-publish once it's rebuilt.
  • One line in MAPLE.md (874939a) says that.

maple/0.17-publish is now one commit behind maple/0.17. After your line-ending fix and the rebuild, we push maple-v0.17.0-maple.1 at the commit you name and approve the publish. The bootstrap token is being added to maple-crates now.

@AnthonyRonning
AnthonyRonning deleted the ci/maple-publish-workflow branch November 25, 2026 17:21
@AnthonyRonning

Copy link
Copy Markdown
Author

We didn't wait for the line-ending fix, since it changes nothing that ships in the crates. I rebuilt maple/0.17-publish on 57ddac5 as 0e99595 (your rename commit cherry-picked, crates and both Cargo files byte-identical to 9e57a2b) and pushed the tag maple-v0.17.0-maple.1 there. The check job is running now. Rebuild again as usual when your fix lands; the tag keeps the published commit.

@AnthonyRonning

Copy link
Copy Markdown
Author

Both crates are on crates.io.

  • Versions: maple-sigstore-rekor 0.17.0-maple.1 and maple-sigstore-verify 0.17.0-maple.1, published Nov 25 at 18:06 UTC from 0e99595, tag maple-v0.17.0-maple.1. Each crate records that commit, and every source file in both matches it.
  • Checks first: the tag's check job passed: 704 tests, including the managed-key corpus and the conformance vectors, and the two-crate dry run.
  • How it authenticated: this first version was uploaded from Anthony's machine with a short-lived crates.io token limited to new maple-sigstore-* crates, through the same script and order the workflow uses. No token was stored in GitHub. Later versions go through maple-publish.yml with trusted publishing; Anthony is adding the per-crate entries next.
  • Owner: AnthonyRonning (user), the same as maple-sdk. There is no team to add.
  • Resolves: a fresh project depending on maple-sigstore-verify = "=0.17.0-maple.1" locks both Maple crates plus upstream 0.17.0 for the unmodified ones.

You can switch Maple PR 1672 to the published crates.

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.

2 participants