Skip to content

Commit 7081572

Browse files
committed
chore: remove duplicate release-plz logic
1 parent a2de727 commit 7081572

2 files changed

Lines changed: 26 additions & 17 deletions

File tree

scripts/postversion.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@ set -euxo pipefail
44
VERSION=$(jq -r .version package.json)
55
MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1)
66

7-
# create the version tag
8-
git tag "v$VERSION"
7+
# create the version tag (allow it to fail if it already exists)
8+
git tag "v$VERSION" || echo "Tag v$VERSION already exists locally"
99

1010
# push changes to github
1111
git push
1212
# push the current tag to github
13-
git push origin "v$VERSION"
13+
git push origin "v$VERSION" || echo "Tag v$VERSION already exists on remote"
14+
1415
# set the major version tag to this release
1516
git tag "v$MAJOR_VERSION" -f
16-
# push the major version tag to github
17-
git push origin "v$MAJOR_VERSION" -f
18-
# create a release on github
19-
gh release create "v$VERSION" --generate-notes --verify-tag
17+
# push the major version tag to github (retry with pull if it fails)
18+
if ! git push origin "v$MAJOR_VERSION" -f; then
19+
echo "Failed to push v$MAJOR_VERSION tag, pulling and retrying..."
20+
git fetch origin "refs/tags/v$MAJOR_VERSION:refs/tags/v$MAJOR_VERSION" -f
21+
git tag "v$MAJOR_VERSION" -f
22+
git push origin "v$MAJOR_VERSION" -f
23+
fi
24+
25+
# check if release already exists before creating
26+
if gh release view "v$VERSION" >/dev/null 2>&1; then
27+
echo "Release v$VERSION already exists, skipping creation"
28+
else
29+
# create a release on github
30+
gh release create "v$VERSION" --generate-notes --verify-tag
31+
fi

scripts/release-plz.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,12 @@ if [ -n "$latest_release_version" ] && [ "$cur_pkg_version" = "$latest_release_v
6868
echo "Updated existing release PR"
6969
fi
7070
elif [ -n "$cur_pkg_version" ] && [ "$cur_pkg_version" != "$latest_release_version" ]; then
71-
# Package version is different from latest release, so cut a release
72-
echo "Package version v$cur_pkg_version is newer than latest release $latest_release. Creating release."
73-
74-
# Configure git for automated commits
75-
git config user.name mise-en-dev
76-
git config user.email 123107610+mise-en-dev@users.noreply.github.com
77-
78-
./scripts/postversion.sh
71+
# Package version is different from latest release
72+
echo "Package version v$cur_pkg_version is newer than latest release $latest_release."
73+
echo "Release will be created by the release.yml workflow when the PR is merged."
74+
# Exit successfully - the release.yml workflow handles actual release creation
75+
exit 0
7976
else
80-
echo "Could not determine release status"
81-
exit 1
77+
echo "No action needed"
78+
exit 0
8279
fi

0 commit comments

Comments
 (0)