Releasing a new version¶
The repository ships the Rust workspace to crates.io and the TypeScript SDK to npm from a single Git tag. All artifacts must carry the same semver string — the CI job release.yml refuses to publish otherwise.
One-shot release with cargo-release¶
Install cargo-release once:
Then cut a release with a single command:
That command, driven by release.toml at the workspace root, does the following in order:
- Bumps
[workspace.package].versionin the rootCargo.toml. - Rewrites every
path = "../foo", version = "X.Y.Z"inter-crate pin insidecrates/*/Cargo.tomlto the new version (dependent-version = "upgrade"). - Rewrites the
"version"field in the rootpackage.jsonandpackages/ts-sdk/package.json. - Commits the result as
chore(release): vX.Y.Z. - Creates and pushes the
vX.Y.Ztag.
Pushing the tag triggers .github/workflows/release.yml, which runs scripts/check-release-version.mjs to verify all four places agree (defence in depth against a pre-release-replacements bug) and then publishes both targets in parallel:
- npm —
packages/ts-sdkis built and pushed as@fabifont/open-redact-pdf. - crates.io —
scripts/publish-crates.shpublishes the eight Rust crates in topological order with retry-on-propagation-delay.
pdf_wasm is excluded from crates.io (publish = false in its Cargo.toml) because it is the wasm-bindgen wrapper bundled into the npm package.
Manual fallback¶
If you cannot run cargo-release locally, the release is still reproducible by hand:
- Edit
[workspace.package].versionin the rootCargo.toml. - For every crate under
crates/*, edit everypath = ..., version = "X.Y.Z"pin to the new version. - Edit the
"version"field inpackage.jsonandpackages/ts-sdk/package.json. cargo build --workspaceonce to refreshCargo.lock.- Commit, tag
vX.Y.Z, push the tag.
Run node scripts/check-release-version.mjs v$NEW_VERSION before pushing to catch any mismatches locally; CI will run the same check and block the publish if it fails.
Related files¶
release.toml— cargo-release configurationscripts/check-release-version.mjs— cross-manifest version invariant check (run in CI)scripts/publish-crates.sh— ordered crates.io publish with propagation retries.github/workflows/release.yml— CI glue triggered by thev*tag