Skip to content

Commit

Permalink
[skip ci] Change release procedure to use cargo-release
Browse files Browse the repository at this point in the history
Remove the example Cargo.toml entry from README.md because it's obvious,
and it creates extra work at release time.
  • Loading branch information
asomers committed Sep 29, 2021
1 parent 150579c commit 1b5476a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 40 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,10 @@ Tier 3:
* x86_64-unknown-openbsd
* x86_64-unknown-redox

## Usage
## Minimum Supported Rust Version (MSRV)

`nix` requires Rust 1.46.0 or newer.

To use `nix`, add this to your `Cargo.toml`:

```toml
[dependencies]
nix = "0.22.0"
```
nix is supported on Rust 1.46.0 and higher. It's MSRV will not be
changed in the future without bumping the major or minor version.

## Contributing

Expand Down
40 changes: 9 additions & 31 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,16 @@ library.

# Before Release

Based on changes since the last release, pick a new 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.
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
support for some Rust versions counts as a breaking change, and requires a
major bump.

The release is prepared as follows:

- Ask for a new libc version if, necessary. It usually is.
- Make a commit with a message like "Release v0.8.3" with the following
changes:
- In `CHANGELOG.md`, rename the Unreleased section to the new version
followed by the date of the release.
- Add a new Unreleased section header to `CHANGELOG.md` with the four
Added, Changed, Fixed, and Removed sections added.
- In `Cargo.toml`, update the version to the new version.
- In `Cargo.toml`, change the libc dependency to the latest version.
- In `README.md`, update the version in the Usage section to the new
version.
- Ask for a new libc version if, necessary. It usually is. Then update the
dependency in Cargo.toml accordingly.
- Confirm that everything's ready for a release by running
`cargo publish --dry-run`
- Make a pull request.
- Once the PR is merged, tag the merge commit, e.g. `git tag v0.8.3
$MERGE_COMMIT_SHA1`.
- Push the tag, e.g. `git push origin v0.8.3`.

# Create Release

- Checkout the tag.
- Publish to crates.io with `cargo publish`.

# After Release

Once a release is done, all that's left is to change the `libc` version
back to using the version from git. So make a pull request containing a
simple commit entitled "Start the next dev cycle" that changes the `libc`
dependency in `Cargo.toml` to using it from git master.
`cargo release --dry-run <patch|minor|major>`
- Create the release with `cargo release <patch|minor|major>`
5 changes: 5 additions & 0 deletions release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
no-dev-version = true
pre-release-replacements = [
{ file="CHANGELOG.md", search="Unreleased", replace="{{version}}" },
{ file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}" }
]

0 comments on commit 1b5476a

Please sign in to comment.