This guide describes how to cut releases and publish them to crates.io for ic-stable-structures.
- Ship improvements without breaking users
- Validate APIs and memory model before stabilization
- Keep rollback cheap
-
Opt-in feature flags
Hide experimental code behind non-default flags. -
Semantic Versioning Pre-Releases (semver.org)
x.y.z-alpha.N— experimental, incomplete, may be unstable or buggyx.y.z-beta.N— feature complete, testing needed, bugs expectedx.y.z-rc.N— release candidate, no new features, only bug fixes
Cargo won’t auto-pick pre-releases; users must pin them explicitly.
- Any breaking and/or major change requires a design doc reviewed by stakeholders before release.
- Pre-releases (
-alpha,-beta,-rc) are strongly encouraged for high-risk changes.
-
Public API changes
- Added methods → behind a feature flag until validated
- Removed/signature changes → breaking (minor bump <1.0.0, major bump ≥1.0.0)
-
Stable memory layout changes
- New/altered layout → feature flag + pre-release
- Layout-breaking (cannot read old data) → breaking (minor bump <1.0.0, major bump ≥1.0.0)
-
Processing-only changes (no layout change)
- Compatible algorithmic updates → minor bump
- High risk → feature flag and/or pre-release
- Examples
- Changing default values, coercions, or type conversions
- Altering validation rules
- Updating how parsing, ordering, deduplication, or filtering logic is applied
- Modifying error handling or recovery behavior when reading/writing to stable memory
-
Hidden layout migrations (auto-migrate on load)
- If old data won’t load without migration → treat as breaking
- Ship via feature flag + pre-releases; promote only after successful trials
Adding a reclaim() method to free unused memory without changing layout, only processing it differently, is high risk and may cause data corruption:
- Hide
reclaim()behind a feature flag - High risk → release as
-beta.N - Iterate with feedback, promote to stable once validated
- Remove feature flag after stabilization
-
Bump version in
Cargo.toml:[package] version = "x.y.z"
-
Ensure CI is green.
-
Preferable commit & PR name:
chore(release): vX.Y.Z(example PR).
- Identify the commit to release.
- Draft a new release:
- Go to the Releases tab.
- Click Draft a new release.
- Create a new tag
vX.Y.Zpointing to the commit. - Set the release title to
vX.Y.Z. - Choose the previous tag as the last release.
- Add release notes (GitHub can auto-generate, adjust as needed).
- Click Publish release.
- On the repository main page, navigate to the
Actionstab. - Click on the workflow to publish to crates.io
- Click on
run workflowand select the version tag created above for the workflow to run on.