Skip to content

Commit

Permalink
ci: Add bash script to easily perform a release
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Dec 21, 2023
1 parent b46ced6 commit ba03b9b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e

# Check if version argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <new_version>"
exit 1
fi
new_version=$1

# Update changelog
git cliff -o CHANGELOG.md

# Update version in Cargo.toml
sed -i "s/^version = \"[0-9]*\.[0-9]*\.[0-9]*\"\$/version = \"$new_version\"/" "Cargo.toml"

# Create and push tag
git tag -a v$new_version -m "v$new_version"

git push origin v$new_version

git cliff -o CHANGELOG.md

gmsg "🎉 $new_version released" || true
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [0.5.2](https://github.com/vemonet/ptrie/compare/v0.5.1..v0.5.2) - 2023-12-21

### ⚙️ Miscellaneous Tasks

- Bump to 0.5.2 - ([b46ced6](https://github.com/vemonet/ptrie/commit/b46ced6bde2ce59d061b212ac6a9fbbad4faae75))

## [0.5.1](https://github.com/vemonet/ptrie/compare/v0.5.0..v0.5.1) - 2023-12-21

### ⚙️ Miscellaneous Tasks
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ Publishing artifacts will be done by the `build.yml` workflow, make sure you hav
2. Bump the version in the `Cargo.toml` file, create a new tag with `git`, and update changelog using [`git-cliff`](https://git-cliff.org):

```bash
git tag -a v0.5.0 -m "v0.5.0"
git push origin v0.5.0
git cliff -o CHANGELOG.md
./.github/release.sh 0.5.0
```

3. Commit, and push. The `release.yml` workflow will automatically create the release on GitHub, and publish to crates.io.

0 comments on commit ba03b9b

Please sign in to comment.