Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:WordPress/block-development-exampl…
Browse files Browse the repository at this point in the history
…es into trunk
  • Loading branch information
juanmaguitar committed Feb 27, 2025
2 parents 2dcb007 + 687ede8 commit 82004db
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/release-zips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,32 @@ jobs:
gh release upload "${{ env.RELEASE_TAG }}" "$file"
done
# Update or create the "latest" release tag
- name: Update Latest Release
- name: Update or Create Latest Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Delete existing latest tag and release if they exist
gh release delete latest --yes || true
git push origin :latest || true
# Create new latest release
gh release create latest \
--title "Latest Release" \
--notes "This is always the latest release. For permanent links, use the dated releases." \
--latest
# Upload files to latest release
# Check if the latest release exists
if gh release view latest; then
# Check if the release is a draft and publish it if needed
if gh release view latest --json isDraft --jq '.isDraft'; then
echo "Publishing the draft release..."
gh release edit latest --draft=false
fi
# Update the existing release
gh release edit latest \
--title "Latest Release" \
--notes "This is always the latest release. For permanent links, use the dated releases." \
--latest
else
# Create the latest release if it doesn't exist
gh release create latest \
--title "Latest Release" \
--notes "This is always the latest release. For permanent links, use the dated releases." \
--latest
fi

# Upload files to the latest release
for file in zips/*.zip; do
[ -e "$file" ] || continue
gh release upload latest "$file" --clobber
Expand Down

0 comments on commit 82004db

Please sign in to comment.