Skip to content

Commit

Permalink
feat: Update release script, make sure the major tag alway point to t…
Browse files Browse the repository at this point in the history
…he latest version
  • Loading branch information
hustcer committed Jun 10, 2024
1 parent 24d1532 commit 76eebb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nu/release.nu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export def 'make-release' [
echo $'The version ($releaseVer) already exists, Please choose another version.(char nl)'
exit 5
}
let majorTag = $releaseVer | split row '.' | first
let statusCheck = (git status --porcelain)
if not ($statusCheck | is-empty) {
echo $'You have uncommit changes, please commit them and try `release` again!(char nl)'
Expand All @@ -34,5 +35,9 @@ export def 'make-release' [
# Delete tags that not exist in remote repo
git fetch origin --prune '+refs/tags/*:refs/tags/*'
let commitMsg = $'A new release for version: ($releaseVer) created by Release command of setup-bend.'
git tag $releaseVer -am $commitMsg; git push origin --tags
git tag $releaseVer -am $commitMsg
# Remove local major version tag if exists and ignore errors
do -i { git tag -d $majorTag | complete | ignore }
git checkout $releaseVer; git tag $majorTag
git push origin $majorTag $releaseVer --force
}

0 comments on commit 76eebb5

Please sign in to comment.