diff --git a/scripts/postversion.sh b/scripts/postversion.sh index ab5a8c3..ea7a2b8 100755 --- a/scripts/postversion.sh +++ b/scripts/postversion.sh @@ -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 diff --git a/scripts/release-plz.sh b/scripts/release-plz.sh index 9a9ed40..671ca3b 100755 --- a/scripts/release-plz.sh +++ b/scripts/release-plz.sh @@ -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