This document describes how to cut a release of the Sovereign SDK.
Before starting, ensure your local copy of the repository is up to date with the latest commit on nightly
and has no untracked or uncommitted changes. Making a fresh clone of the repository is a good way to ensure this.
- Decide a new version number. During alpha, This should have the form
vA.B.C-alpha
whereA, B, C
are natural numbers. Since we're pre1.0
releases which are not backwards compatible should get a newminor
version, while releases which are backwards compatible only receive apatch
version bump. Since almost all of our releases contain breaking changes, we'll almost always bump the minor version (i.e. fromv0.1.0-alpha
tov0.2.0-alpha
)- Don't forget the
v
!
- Don't forget the
- Create a new local branch named
release/{version}
(e.g.release/v0.2.0-alpha
) fromnightly
.
- Audit the getting-started documentation and ensure there's no breakages:
- Manually run the steps from
examples/demo-rollup/README.md
. - Manually run the steps from
examples/demo-prover/README.md
.
- Manually run the steps from
- Review all the other tutorials and ensure explanations are up to date:
-
examples/demo-nft-module/README.md
-
examples/demo-simple-stf/README.md
-
examples/demo-rollup/stf/README.md
-
examples/demo-nft-module/README.md
-
- Audit
packages_to_publish.yml
and ensure that all relevant library crates are included. Binaries (such asdemo-rollup
) and other internal crates not intended to be used by SDK users (such assov-modules-schemas
) should not be included. The list must remain pre-sorted by dependencies, so that crates are published in the correct order. - Commit any changes.
For each and every crate in this repository, you'll need to do three things:
- Update the crate's version number.
- Update the crate's
sov-*
dependencies to the new version, unless they are sourced from a relativepath = "..."
instead of a version number. In that case there's no dependency version to update, and you can skip it. - Update the crate's
sov-*
dev-dependencies to the new version, just like you did in step 2.
The cargo set-version
subcommand supplied by cargo-edit
does all of this for you automatically. Invoke it like this:
$ cargo set-version 0.2.0 # From the root of the repository
Note that cargo set-version
only acts within the current workspace, so you'll have to run it once for every workspace in the repository. You can find all workspaces by searching for [workspace]
.
Dependencies across workspace boundaries will not be updated automatically by cargo set-version
. After running the command, do a final search for the old version number and ensure that it's not used anywhere (except possibly by unrelated 3rd-party dependencies). The good news is that even if you miss any dependency during this step, it will not block the release because only crates within the root workspaces are published to https://crates.io.
At this point, the branch you're working on should contain two kinds of changes:
- (Optional.) Documentation updates, tutorial fixes, etc..
- Updated Cargo manifests.
- Updated
Cargo.lock
files.
After committing these changes, you should open a new PR against nightly
. Ensure all tests and lints pass but do not merge just yet!
After the PR is approved but before it's merged, you should release the crates in packages_to_publish.yml
to https://crates.io. Go through the list of crates to release in order and run these commands:
-
$ cargo publish --dry-run -p {crate}
to ensure there are no issues. -
$ cargo publish -p {crate}
to actually release the crate.
- Create a new tag named
{version}
(e.g.v0.2.0-alpha
) from therelease/{version}
branch. - Push the tag (
git push origin {version}
) - Create a new GitHub release from the tag here. The release title should be the version number (e.g.
v0.2.0-alpha
). Consult the team to decide on a good release description.
- Merge your PR to
nightly
. - Merge
nightly
tostable
with a new PR (example here). Make sure no commits that are not part of the release get merged accidentally intostable
.