Skip to content

Commit

Permalink
docs: update release procedure[skip ci] (#2415)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored May 25, 2024
1 parent c003ae9 commit 1df1069
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library.

Nix uses [cargo release](https://github.com/crate-ci/cargo-release) to automate
the release process. Based on changes since the last release, pick a new
version number following semver conventions. For nix, a change that drops
version number following semver conventions. For Nix, a change that drops
support for some Rust versions counts as a breaking change, and requires a
major bump.

Expand All @@ -14,24 +14,53 @@ The release is prepared as follows:
> NOTE: the following procedure should be done directly against the master
> branch of the repo.
- Ask for a new libc version if, necessary. It usually is. Then update the
dependency in `Cargo.toml` to rely on a release from crates.io.
- Clone the `nix-rust/nix` repository with your preferred way, and `cd` to it:

```sh
$ git clone https://github.com/nix-rust/nix.git
$ cd nix
```

- If we are using `libc` from git, replace it with a usable release from crates.io.

```diff
[dependencies]
-libc = { git = "https://github.com/rust-lang/libc", rev = "<Revision>", features = ["extra_traits"] }
+libc = { version = "<New Version>", features = ["extra_traits"] }
+libc = { version = "<Version>", features = ["extra_traits"] }
```

- Update the version number in `Cargo.toml`
- Generate `CHANGELOG.md` for this release by
`towncrier build --version=<VERSION> --yes`

```sh
$ towncrier build --version=<VERSION> --yes
Loading template...
Finding news fragments...
Rendering news fragments...
Writing to newsfile...
Staging newsfile...
Removing the following files:
nix/changelog/xxxx.xxxx.md
nix/changelog/xxxx.xxxx.md
...
nix/changelog/xxxx.xxxx.md
Removing news fragments...
Done!
```

- Push the changes made by the above steps to the master branch

- Ensure you have a crates.io token
1. With the `publich-update` scope
1. With the `publish-update` scope
2. Can be used for crate `nix`
3. It is set via `cargo login`

If not, create a new token [here](https://crates.io/settings/tokens), and set
it.

- Confirm that everything's ready for a release by running
`cargo release <patch|minor|major>`
- Create the release with `cargo release -x <patch|minor|major>`
`cargo release <VERSION>`
- Create the release with `cargo release -x <VERSION>`, this step will publish
the version to crates.io and push the new version tag to GitHub.

- Congratulations on a new Nix release!

0 comments on commit 1df1069

Please sign in to comment.