Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure cargo-release and document the release process. #189

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Releasing and publishing vodozemac

While the release process can be handled manually, cargo-release has been
configured to make it more convenient.

By default, [`cargo-release`](https://github.com/crate-ci/cargo-release) assumes
that no pull request is required to cut a release. However, since the vodozemac
repo is set up so that each push requires a pull request, we need to slightly
deviate from the default workflow.

The procedure is as follows:

1. Switch to a release branch:

```bash
git switch -c release-x.y.z
```

2. Prepare the release. This will update the README.md, prepend the CHANGELOG.md
file using `git cliff`, and bump the version in the `Cargo.toml` file.

```bash
cargo release --no-publish --no-tag --no-push --execute major|minor|patch|rc
```

3. Double-check and edit the changelog and README if necessary. Once you are
satisfied, push the branch and open a PR.

```bash
git push --set-upstream origin/release-x.y.z
```

4. Pass the review and merge the branch as you would with any other branch.

5. Create a tag for your new release:

```bash
# Switch to main first.
git switch main
# Pull in the now-merged release commit(s).
git pull
# Run cargo-release to tag the commit, push the tag, and publish vodozemac on crates.io.
cargo release tag --execute
```

6. Publish the release to crates.io:

```bash
cargo release publish --execute
```

7. Push the tag to the repository:

```bash
cargo release push --execute
```

8. Create a GitHub release from the pushed tag and copy the updates from the
changelog to the GitHub release.

For more information on cargo-release: https://github.com/crate-ci/cargo-release
13 changes: 13 additions & 0 deletions release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
owners = ["poljar", "dkasak"]

pre-release-commit-message = "chore: Release {{crate_name}} version {{version}}"
pre-release-replacements = [
{file="README.md", search="vodozemac = .*", replace="{{crate_name}} = \"{{version}}\""},
]
pre-release-hook = ["git", "cliff", "--prepend", "CHANGELOG.md", "--unreleased", "--tag", "{{version}}" ]
poljar marked this conversation as resolved.
Show resolved Hide resolved

sign-tag = true
tag-message = "Release {{crate_name}} version {{version}}"
tag-name = "{{prefix}}{{version}}"
poljar marked this conversation as resolved.
Show resolved Hide resolved

enable-all-features = true