Skip to content

Commit

Permalink
Update make-new-release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
zoni committed Dec 3, 2023
1 parent 7bbd211 commit 90d7dc3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions make-new-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,28 @@ get_next_version_number() {
done
}

VERSION=$(get_next_version_number)
git add .
if ! git diff-index --quiet HEAD; then
printf "Working directory is not clean. Please commit or stash your changes.\n"
exit 1
fi

sed -i -E "s/^version = \".+\"$/version = \"${VERSION}\"/" Cargo.toml
cargo check
git commit "Cargo.*" --message "Release v${VERSION}"
VERSION=$(get_next_version_number)
git tag "v${VERSION}"

git cliff --latest --prepend CHANGELOG.md > /dev/null
${EDITOR:-vim} CHANGELOG.md
docs/generate.sh
git add CHANGELOG.md README.md
git commit --amend --no-edit

sed -i -E "s/^version = \".+\"$/version = \"${VERSION}\"/" Cargo.toml
cargo check

git add .
# There are likely trailing whitespace changes in the changelog, but a single
# run of pre-commit will fix these automatically.
pre-commit run || git add .

git commit --message "Release v${VERSION}"
git tag "v${VERSION}" --force

printf "\n\nSuccessfully created release %s\n" "v${VERSION}"
Expand Down

0 comments on commit 90d7dc3

Please sign in to comment.