This document describes how openjd-rs crates are released to crates.io.
Releases are automated with release-plz. Every push
to main runs the Release-plz workflow,
which opens (or updates) a Release PR titled "chore: release". When the
Release PR is merged, the same workflow publishes the updated crates to
crates.io, tags the release commit, and creates a GitHub Release for each
crate that was published.
Version bumps are determined from conventional commit
messages on the main branch:
| Commit prefix | Bump |
|---|---|
fix:, perf:, docs:, refactor:, test:, ci:, chore: |
patch |
feat: |
minor |
any type with ! suffix or a BREAKING CHANGE: footer |
major |
Pre-1.0 note: while a crate is still in the 0.x.y range, feat bumps the
patch (not the minor) because the 0.x line is considered pre-stable. This is
release-plz's default behavior.
Each crate is versioned independently: release-plz only bumps the crates whose files have changed since their last release, cascading bumps through dependents when an intra-workspace dependency's version changes.
| Crate | Published? |
|---|---|
openjd-expr |
✅ yes |
openjd-model |
✅ yes |
openjd-sessions |
✅ yes |
openjd-cli |
✅ yes |
openjd-snapshots |
✅ yes |
openjd-for-js |
❌ no (publish = false, built as npm package) |
release-plz.toml— release-plz configuration: which crates are published, changelog template, conventional-commit → section map..github/workflows/release-plz.yml— the automation workflow (runs on push tomain).
This repo authenticates to crates.io via Trusted Publishing
(OIDC). The workflow exchanges a short-lived GitHub Actions OIDC token for a
short-lived crates.io publish token. No long-lived CARGO_REGISTRY_TOKEN
secret is stored in the repo.
The process is:
- Land regular PRs on
mainusing conventional commits. - Release-plz automatically opens/updates a single Release PR per workspace. The PR shows the proposed version bumps and CHANGELOG entries.
- A maintainer reviews the Release PR, edits the CHANGELOG entries if desired, and merges it.
- On the post-merge run, release-plz publishes the changed crates to
crates.io, creates git tags (
<crate-name>-v<version>), and creates GitHub Releases.
If you need to force a particular bump (for example, to cut a 0.2.0 after a
series of fix: commits), edit the Release PR directly before merging. You
can change the version line in each Cargo.toml and update the CHANGELOG
accordingly; release-plz will respect your edits.
Use the standard Cargo tooling:
cargo yank --version <version> <crate-name>Yanks are not automated by release-plz.
- Create the crate under
crates/<new-crate>/. EnsureCargo.tomlsets:version = "0.1.0"- Workspace inherits for
edition,license,rust-version,authors,repository,homepage,readme. - Its own
description,keywords(max 5),categories. - Intra-workspace deps specify both
pathandversion, e.g.openjd-expr = { path = "../openjd-expr", version = "0.1.0" }. LICENSE-Apache-2.0,LICENSE-MIT, andNOTICEsymlinked from the workspace root (ln -sf ../../LICENSE-Apache-2.0 crates/<new-crate>/).
- Add a
[[package]]entry for it inrelease-plz.toml. - Perform the one-time crate setup: manually publish the first version with
cargo publish -p <new-crate>in dependency order, then register Trusted Publishing for it on crates.io pointing at this repo and therelease-plz.ymlworkflow.
Add publish = false to [package] in its Cargo.toml, and an entry in
release-plz.toml with publish = false, release = false,
changelog_update = false.