Allow GH releases to be created from workflow
Submission Review Guidelines:
- I have followed the WooCommerce Contributing Guidelines and the WordPress Coding Standards.
- I have checked to ensure there aren't other open Pull Requests for the same update/change.
- I have reviewed my code for security best practices.
- Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.
Changes proposed in this Pull Request:
This PR introduces a few enhancements in the "build ZIP" workflow. Specifically:
- Simplifies the language for the various options.
- Fixes a workflow failure when the verification step was skipped.
- Adds support for running the workflow from
trunkwhile building a specific release branch, so backporting fixes to this workflow to the release branch will no longer be required before building. - Allows a draft release to be created from while building the ZIP.
Related to #57898.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
-
Create a fork of the WooCommerce repository and ensure that
trunkis set to this specific branch and that it has at least therelease/9.9branch (useful for testing the workflow). You can achieve the above using the CLI:git remote add my_fork [email protected]:<GITHUB USERNAME>/woocommerce.git git push my_fork enhancement/57898:trunk -f git push my_fork release/9.9⚠️ Be careful not to push to
originbut always tomy_fork. -
Go to Actions > Release: Build ZIP file in your forked repo and run the workflow with the following configurations.
Ensure the outcome is as expected and in all cases confirm that the ZIP attached to both the workflow and the release (if any) has the correct version.
Source branch Create a draft GitHub release Expected Result release/9.9(checked) Draft 9.9.4 release in Releases with attached file woocommerce.zip.trunk(checked) Should fail because trunkis not a release branch.my-super-branch(checked) Build fails due to incorrect source branch name. (empty) (unchecked) ZIP attached to workflow as asset should be 10.0.0-dev.
No draft release created.I suggest running with Skip the PR verification step checked off to speed up testing. Do at least one run with it unchecked to make sure the checks are correct. In this case you might need to temporarily bump the version to 9.9.4 in
release/9.9since the checks prevent releasing a tag that already exists on wporg.
Testing that has already taken place:
Changelog entry
- [ ] Automatically create a changelog entry from the details below.
- [ ] This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details
Significance
- [ ] Patch
- [ ] Minor
- [ ] Major
Type
- [ ] Fix - Fixes an existing bug
- [ ] Add - Adds functionality
- [ ] Update - Update existing functionality
- [ ] Dev - Development related task
- [ ] Tweak - A minor adjustment to the codebase
- [ ] Performance - Address performance issues
- [ ] Enhancement - Improvement to existing functionality
Message
Changelog Entry Comment
Comment
Testing Guidelines
Hi @kalessil ,
Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.
Reminder: PR reviewers are required to document testing performed. This includes:
- 🖼️ Screenshots or screen recordings.
- 📝 List of functionality tested / steps followed.
- 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
- 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.
⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.
📝 Walkthrough
Walkthrough
The workflow configuration for release builds was updated by renaming the input parameter ref to branch, adding two new boolean inputs (skip_verify and create_github_release), and refining job conditions and steps. A new job was introduced to automate GitHub release creation, and artifact retention was shortened. Changelog verification was removed.
Changes
| File(s) | Change Summary |
|---|---|
| .github/workflows/release-build-zip-file.yml | Renamed input ref to branch; added skip_verify and create_github_release boolean inputs; updated job conditions and steps; removed changelog verification; improved branch checkout logic; reduced artifact retention; added create-release job for GitHub release automation. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant GitHub Actions
participant WordPress.org API
participant GitHub Releases
User->>GitHub Actions: Trigger workflow with inputs (branch, skip_verify, create_github_release)
GitHub Actions->>GitHub Actions: Checkout specified branch
alt skip_verify is false
GitHub Actions->>WordPress.org API: Check if release tag exists
WordPress.org API-->>GitHub Actions: Tag existence result
end
GitHub Actions->>GitHub Actions: Build ZIP artifact
alt create_github_release is true
GitHub Actions->>GitHub Releases: Create draft release with version tag
GitHub Actions->>GitHub Releases: Upload ZIP artifact
GitHub Releases-->>GitHub Actions: Release URL
end
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Explain this complex logic. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai explain this code block. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and explain its main purpose. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@kalessil: This is ready for another look whenever you have the chance. Thanks!
This is ready for another look whenever you have the chance. Thanks!
Thank you @jorgeatorres. Leaving a single comment and meanwhile going through the testing steps.