Skip to content

Commit 998ad36

Browse files
committed
Release script
Signed-off-by: Sora Morimoto <sora@morimoto.io>
1 parent 3b4923e commit 998ad36

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

scripts/release.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
function Release() {
4+
local MAJOR_VERSION="$1"
5+
local FULL_VERSION="$2"
6+
7+
if [ -z "$MAJOR_VERSION" ] || [ -z "$FULL_VERSION" ]; then
8+
echo "Usage: release.sh [MAJOR_VERSION] [FULL_VERSION]"
9+
echo "Example: release.sh v1 v1.0.0"
10+
exit 1
11+
fi
12+
13+
echo "Delete a major version tag: $MAJOR_VERSION"
14+
git tag -d "$MAJOR_VERSION"
15+
git push origin ":$MAJOR_VERSION"
16+
17+
echo "Create a major version tag: $MAJOR_VERSION"
18+
git tag "$MAJOR_VERSION"
19+
20+
echo "Create a full version tag: $FULL_VERSION"
21+
git tag "$FULL_VERSION"
22+
23+
echo "Push tags"
24+
git push --tags
25+
}
26+
27+
Release "$1" "$2"

0 commit comments

Comments
 (0)