mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-15 06:10:32 +00:00
fix: v2 release tag automation
This commit is contained in:
parent
df7d3c87bf
commit
5c24f96c0f
2 changed files with 7 additions and 6 deletions
|
|
@ -2,14 +2,15 @@
|
|||
set -euxo pipefail
|
||||
|
||||
VERSION=$(jq -r .version package.json)
|
||||
MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1)
|
||||
|
||||
# push changes to github
|
||||
git push
|
||||
# push the current tag to github
|
||||
git push origin "v$VERSION"
|
||||
# set the v1 tag to this release
|
||||
git tag v2 -f
|
||||
# push the v1 tag to github
|
||||
git push origin v2 -f
|
||||
# set the major version tag to this release
|
||||
git tag "v$MAJOR_VERSION" -f
|
||||
# push the major version tag to github
|
||||
git push origin "v$MAJOR_VERSION" -f
|
||||
# create a release on github
|
||||
gh release create "v$VERSION" --generate-notes --verify-tag
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ cur_version="$(jq -r .version package.json)"
|
|||
# Check if this version has already been released
|
||||
released_versions="$(git tag --list | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$')"
|
||||
if ! echo "$released_versions" | grep -q "^v$cur_version$"; then
|
||||
git tag -d "v$cur_version"
|
||||
node ./scripts/postversion.sh
|
||||
git tag -d "v$cur_version" 2>/dev/null || true
|
||||
./scripts/postversion.sh
|
||||
fi
|
||||
|
||||
# Get the next version and changelog from git-cliff
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue