Skip to content

Commit

Permalink
Add release script to help others more easily release
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Nov 21, 2023
1 parent 421cfd0 commit c1cfa61
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

function Release() {
local MAJOR_VERSION="$1"
local FULL_VERSION="$2"

if [ -z "$MAJOR_VERSION" ] || [ -z "$FULL_VERSION" ]; then
echo "Usage: release.sh [MAJOR_VERSION] [FULL_VERSION]"
echo "Example: release.sh v1 v1.0.0"
exit 1
fi

echo "Delete a major version tag: $MAJOR_VERSION"
git tag -d "$MAJOR_VERSION"
git push origin ":$MAJOR_VERSION"

echo "Create a major version tag: $MAJOR_VERSION"
git tag "$MAJOR_VERSION"

echo "Create a full version tag: $FULL_VERSION"
git tag "$FULL_VERSION"

echo "Push tags"
git push --tags
}

Release "$1" "$2"

0 comments on commit c1cfa61

Please sign in to comment.