Skip to content

Commit

Permalink
feat: Try to make sure major vesion tag always point to the latest se…
Browse files Browse the repository at this point in the history
…mver tag
  • Loading branch information
hustcer committed May 5, 2024
1 parent 9a4713c commit 0e037c5
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' [
print $'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) {
print $'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-nu'
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
}

0 comments on commit 0e037c5

Please sign in to comment.