chore: remove duplicate release-plz logic

This commit is contained in:
jdx 2025-08-18 11:57:51 -05:00
parent a2de727769
commit 70815728fd
No known key found for this signature in database
GPG key ID: 584DADE86724B407
2 changed files with 26 additions and 17 deletions

View file

@ -4,16 +4,28 @@ set -euxo pipefail
VERSION=$(jq -r .version package.json)
MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1)
# create the version tag
git tag "v$VERSION"
# create the version tag (allow it to fail if it already exists)
git tag "v$VERSION" || echo "Tag v$VERSION already exists locally"
# push changes to github
git push
# push the current tag to github
git push origin "v$VERSION"
git push origin "v$VERSION" || echo "Tag v$VERSION already exists on remote"
# 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
# push the major version tag to github (retry with pull if it fails)
if ! git push origin "v$MAJOR_VERSION" -f; then
echo "Failed to push v$MAJOR_VERSION tag, pulling and retrying..."
git fetch origin "refs/tags/v$MAJOR_VERSION:refs/tags/v$MAJOR_VERSION" -f
git tag "v$MAJOR_VERSION" -f
git push origin "v$MAJOR_VERSION" -f
fi
# check if release already exists before creating
if gh release view "v$VERSION" >/dev/null 2>&1; then
echo "Release v$VERSION already exists, skipping creation"
else
# create a release on github
gh release create "v$VERSION" --generate-notes --verify-tag
fi

View file

@ -68,15 +68,12 @@ if [ -n "$latest_release_version" ] && [ "$cur_pkg_version" = "$latest_release_v
echo "Updated existing release PR"
fi
elif [ -n "$cur_pkg_version" ] && [ "$cur_pkg_version" != "$latest_release_version" ]; then
# Package version is different from latest release, so cut a release
echo "Package version v$cur_pkg_version is newer than latest release $latest_release. Creating release."
# Configure git for automated commits
git config user.name mise-en-dev
git config user.email 123107610+mise-en-dev@users.noreply.github.com
./scripts/postversion.sh
# Package version is different from latest release
echo "Package version v$cur_pkg_version is newer than latest release $latest_release."
echo "Release will be created by the release.yml workflow when the PR is merged."
# Exit successfully - the release.yml workflow handles actual release creation
exit 0
else
echo "Could not determine release status"
exit 1
echo "No action needed"
exit 0
fi