You're ready to release a new version of Nickel - congrats!
This document explains how to do so step by step while keeping the various crates and dependent repositories (such as the website) in a consistent state.
IMPORTANT: Since the 1.4 release, scripts/release.sh takes care of bumping
versions numbers, updating local cross-dependencies, creating a clean release
branch, updating the stable branch and publishing to crates.io.
The covered steps are still described below for your information, but you shouldn't need to actually perform them manually.
You'll still have to do the GitHub release, redeploy nickel-lang.org manually,
and backport changes to master, which are all described below as well.
- A relatively recent bash (> 4.3)
- git
- tomlq
- cargo
- You will need to be signed in to
crates.iowith a GitHub account that is part of the Nickel Core team, and have acrates.ioAPI key saved locally on your machine (normally viacargo login). For help with this, contact the Nickel maintainers.
Once master is in a releasable state, start the script from the root of the
nickel git repository with an argument that is either major, minor or
patch, indicating how to bump the version number. For example:
$./release.sh minor
++ Nickel release script
++
++ This script will:
[..]Some of the crates in the Nickel workspace are libraries which are not versioned according to the version number of the language itself. These are
nickel-lang-corenickel-lang-utilslsp-harnessnickel-wasm-repl
Their version numbers take the form 0.W.U and their public APIs are not
considered stable. Consequently we bump their versions to 0.(W+1).0 on every
release (if needed).
Other crates carry the version number of the Nickel language. These are
nickel-lang-clinickel-lang-lsppy-nickel
IMPORTANT: this section is covered by the release.sh script, and is only
kept for information purpose. Usually, you shouldn't have to perform the
following steps manually.
-
Branch out from
masterto a dedicated branchX.Y.Z-release:git checkout -b X.Y.Z-release -
Bump the overall workspace version number in
Cargo.tomltoX.Y.Z. This will be automatically propagated to the CLI, the Nickel language server and py-nickel. -
Update the current version number mentioned in
doc/manual/introduction.mdwith the new one set in step 2. Grep for the previous version number in the various README files, as the latest version is sometimes mentioned, and update if needed. -
Bump the version number of
coreincore/Cargo.tomlandwasm-repl/Cargo.toml. The two versions must always be the same.Bump the version of the other crates in the workspace if needed (usually, it's safer to always bump the version of
corebecause it's modified all the time without special care about its public API, but the following crates are often left untouched):lsp/lsp-harness/Cargo.tomlutils/Cargo.toml
Afterwards, also adjust the version numbers of the dependencies in
Cargo.toml. For example, innickel-lang-core = { version = "0.1", path = "./core", default-features = false }
adjust the version
0.1to reflect the new version number. -
Make sure that everything builds: run
nix flake checkat the root of the repository. -
Add the changelog since the last release in RELEASES.md. GitHub is able to automatically generate release notes: refer to this guide. While the output needs to be reworked, it's a useful starting point. Commit and push your changes.
-
Set the
stablebranch to point to your newX.Y.Z-release. Because thestablebranch usually contains specific fixes, or cherry-picked commits, we'll have to force push. First save the previous state in a local branch:git checkout stable git branch stable-local-save
Update the
stablebranch:git checkout stable git reset --hard X.Y.Z-release` git push --force-with-lease
If anything goes wrong, you can reset
stableto its previous state:git checkout stable git reset --hard stable-local-save git push --force-with-lease
IMPORTANT: this section is covered by the release.sh script, and is only
kept for information purpose. Usually, you shouldn't have to perform the
following steps manually.
-
Remove references to
nickel-lang-utilsfrom the[dev-dependencies]sections of the crates to be published:./core/Cargo.tomlfornickel-lang-core,./cli/Cargo.tomlfornickel-lang-cliand./lsp/nls/Cargo.tomlfornickel-lang-lsp(work-around for cargo:#4242. -
Remove references to
lsp-harnessfrom the[dev-dependencies]sections of the./lsp/nls/Cargo.toml(workaround for the same issue as 1.). -
Commit the changes made in 1., 2. and 3. temporarily to please cargo, but they will be dropped later. Do not push.
-
Check that a dry run of
cargo publishsucceeds on the crates to be published (nickel-lang-core,nickel-lang-cliandnickel-lang-lsp):cargo publish -p nickel-lang-core --dry-runcargo publish -p nickel-lang-cli --dry-runcargo publish -p nickel-lang-lsp --dry-run
For this to work, you will need to be signed in to
crates.iowith a GitHub account that is part of the Nickel Core team, and have acrates.ioAPI key saved locally on your machine (normally viacargo login). For help with this, contact the Nickel maintainers. -
Actually release
nickel-lang-core,nickel-lang-cliandnickel-lang-lsp(in that order, as the cli and the lsp depend on core) on crates.io:cargo publish -p <crate-to-publish> -
Ditch the potential changes made to the cargo manifests at steps 1., 2. and 3. by dropping the corresponding commit
-
Do the release on GitHub, Make sure that you set
X.Y.Z-releaseas the target branch and have GitHub create theX.Y.Ztag on release. -
Verify that the "Upload release artifacts" GitHub action is getting triggered and completes successfully, uploading a static Nickel binary and a Docker image for both x86-64 and arm64 Linux platforms.
-
Checkout the nickel-lang repository.
-
Branch out from
masterand update the Nickel input:git checkout -b release/X.Y.Z nix flake update nickel git add flake.lock git commit -m "Update to Nickel vX.Y.Z" git push -u origin @
Open a pull request on the nickel-lang repository. Once the CI is green and the PR is merged, nickel-lang.org will be automatically redeployed with the new version of Nickel used for the playground and the documentation.
- Cherry-pick the following commits into separate PRs to
master:- Bumping the version numbers done in Preparation 2.
- Updating release notes done in Preparation 5.
- Fixes that you made locally for
nix flake checkor other commands.
- Profit!