Skip to content

Commit 82004db

Browse files
committed
Merge branch 'trunk' of github.com:WordPress/block-development-examples into trunk
2 parents 2dcb007 + 687ede8 commit 82004db

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

.github/workflows/release-zips.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,32 @@ jobs:
7676
gh release upload "${{ env.RELEASE_TAG }}" "$file"
7777
done
7878
79-
# Update or create the "latest" release tag
80-
- name: Update Latest Release
79+
- name: Update or Create Latest Release
8180
env:
8281
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8382
run: |
84-
# Delete existing latest tag and release if they exist
85-
gh release delete latest --yes || true
86-
git push origin :latest || true
87-
88-
# Create new latest release
89-
gh release create latest \
90-
--title "Latest Release" \
91-
--notes "This is always the latest release. For permanent links, use the dated releases." \
92-
--latest
93-
94-
# Upload files to latest release
83+
# Check if the latest release exists
84+
if gh release view latest; then
85+
# Check if the release is a draft and publish it if needed
86+
if gh release view latest --json isDraft --jq '.isDraft'; then
87+
echo "Publishing the draft release..."
88+
gh release edit latest --draft=false
89+
fi
90+
91+
# Update the existing release
92+
gh release edit latest \
93+
--title "Latest Release" \
94+
--notes "This is always the latest release. For permanent links, use the dated releases." \
95+
--latest
96+
else
97+
# Create the latest release if it doesn't exist
98+
gh release create latest \
99+
--title "Latest Release" \
100+
--notes "This is always the latest release. For permanent links, use the dated releases." \
101+
--latest
102+
fi
103+
104+
# Upload files to the latest release
95105
for file in zips/*.zip; do
96106
[ -e "$file" ] || continue
97107
gh release upload latest "$file" --clobber

0 commit comments

Comments
 (0)