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

Add release script #75

Merged
merged 1 commit into from
Dec 9, 2024
Merged
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
27 changes: 27 additions & 0 deletions create-new-release.sh
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!"
Loading