Update make-new-release.sh

This commit is contained in:
Nick Groenen 2023-12-03 17:33:59 +01:00
parent 7bbd211732
commit 90d7dc3cf4
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098

View File

@ -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}"