woocommerce icon indicating copy to clipboard operation
woocommerce copied to clipboard

Allow GH releases to be created from workflow

Open jorgeatorres opened this issue 10 months ago • 1 comments

Submission Review Guidelines:

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 trunk while 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.
Screenshot 2025-06-12 at 11 06 11

Related to #57898.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Create a fork of the WooCommerce repository and ensure that trunk is set to this specific branch and that it has at least the release/9.9 branch (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 origin but always to my_fork.

  2. 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 trunk is 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.9 since 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

jorgeatorres avatar Jun 09 '25 15:06 jorgeatorres

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.

github-actions[bot] avatar Jun 12 '25 18:06 github-actions[bot]

📝 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.

❤️ Share
🪧 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 @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere 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.

coderabbitai[bot] avatar Jun 27 '25 13:06 coderabbitai[bot]

@kalessil: This is ready for another look whenever you have the chance. Thanks!

jorgeatorres avatar Jun 27 '25 17:06 jorgeatorres

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.

kalessil avatar Jun 30 '25 09:06 kalessil