-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a167450
commit 4bb122c
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Get the version number from Cargo.toml file | ||
NEXT_VERSION=$(grep -m1 version mvr-cli/Cargo.toml | sed 's/[^0-9.]*//g') | ||
|
||
echo "Preparing to create release v$NEXT_VERSION" | ||
|
||
# Check if the tag already exists | ||
if git rev-parse "v$NEXT_VERSION" >/dev/null 2>&1; then | ||
echo "Tag v$NEXT_VERSION already exists. Check that Release v$NEXT_VERSION exists. It might be that Cargo.toml was not updated to the new upcoming version." | ||
exit 1 | ||
fi | ||
|
||
git tag -a "v$NEXT_VERSION" -m "Release v$NEXT_VERSION" | ||
|
||
echo "Tag v$NEXT_VERSION created successfully" | ||
|
||
# Push the tag to the remote repository | ||
git push origin "v$NEXT_VERSION" | ||
|
||
echo "Tag v$NEXT_VERSION pushed to the remote repository" | ||
|
||
echo "Release v$NEXT_VERSION created successfully" | ||
|
||
# Bump the Cargo.toml version | ||
echo "Please bump the version in the Cargo.toml file, commit, and push the commit!" |