fix: v2 release tag automation

This commit is contained in:
jdx 2025-07-27 13:40:47 -05:00
parent df7d3c87bf
commit 5c24f96c0f
No known key found for this signature in database
GPG key ID: 584DADE86724B407
2 changed files with 7 additions and 6 deletions

View file

@ -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

View file

@ -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