add new scripts

This commit is contained in:
c9s 2024-08-21 14:40:29 +08:00
parent 6f0cf8f3e0
commit 3a2e4dfd26
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 21 additions and 0 deletions

9
scripts/bump-minor.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
git fetch origin --tags
tag=$(git tag -l --sort=-version:refname | head -n1 | awk -F. '{$2++; $3=0; print $1"."$2"."$3}')
git tag $tag
git push -f origin HEAD
echo "sleep 3 seconds for CI to detect tag pushing"
sleep 3
git push origin $tag

12
scripts/bump-patch.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
git fetch origin
git fetch origin --tags
tag=$(git tag -l --sort=-version:refname | head -n1 | awk -F . '{OFS="."; $NF+=1; print $0}')
git rebase origin/main
git tag $tag
git push -f origin HEAD
echo "sleep 3 seconds for CI to detect tag pushing"
sleep 3
git push origin $tag