generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release script to help others more easily release
Signed-off-by: Sora Morimoto <sora@morimoto.io>
- Loading branch information
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 @@ | ||
#!/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" |