Skip to content

Release bcmalloc to crates.io and GitHub when a version tag is pushed - #12

Merged
clabby merged 1 commit into
readme-figurefrom
release-workflow
Nov 14, 2026
Merged

clabby merged 1 commit into
readme-figurefrom
release-workflow

Conversation

@clabby

@clabby clabby commented Nov 14, 2026

Copy link
Copy Markdown
Owner

The workflow. .github/workflows/release.yaml runs when a tag that starts with v is pushed. It runs three steps in order:

  1. Validate. The tag must be v plus the version in crates/bcmalloc/Cargo.toml, and crates.io must not have that version yet. The check asks the crates.io API for the version: a 404 passes, a 200 fails as already published, and any other answer fails rather than guessing.
  2. Publish. cargo publish -p bcmalloc --locked. Only bcmalloc is published; the other crates in the workspace have publish = false.
  3. Release. gh release create <tag> --verify-tag --generate-notes. The notes are GitHub's changelog of the pull requests merged since the previous release.

Before the first tag: add a crates.io token that may publish bcmalloc as the CARGO_REGISTRY_TOKEN repository secret. Nobody holds the name on crates.io yet.

Releasing: bump version in crates/bcmalloc/Cargo.toml, merge, then git tag v0.1.0 && git push origin v0.1.0.

Checks:

  • cargo publish -p bcmalloc --dry-run --locked packages and verifies the crate, README symlink included.
  • I ran the validation script locally against the live API:
    • v0.1.0 passes, because the crate is not on crates.io.
    • v0.2.0 fails on the version mismatch.
    • The same script pointed at serde 1.0.0 fails as already published.
  • The workflow has not run on GitHub yet; the first tag will be its first run.

Stacked on #11.

@clabby
clabby added this pull request to stack #10 November 14, 2026 18:54
A new workflow runs on tags that start with v. It checks that the tag names
the version in bcmalloc's manifest and that crates.io does not have that
version yet, publishes the crate, and creates a GitHub release for the tag
with notes that GitHub generates from the pull requests merged since the
last release. Only bcmalloc is published; the other crates in the
workspace have publish = false. Publishing needs a crates.io token in the
CARGO_REGISTRY_TOKEN secret.
@clabby
clabby merged commit 558b2e4 into main Nov 14, 2026
26 checks passed
@clabby
clabby deleted the release-workflow branch November 14, 2026 21:03
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.

1 participant