Skip to content

Conversation

@agibson-godaddy
Copy link
Contributor

@agibson-godaddy agibson-godaddy commented Mar 4, 2025

Summary

This creates a new GitHub workflow "Prepare Release" which handles everything necessary to... prepare a new release! Specifically:

  1. Version bumping
  2. Updating versions in namespaces
  3. etc.

Details

The workflow is a manual trigger only. It can be run from any branch.

After making the necessary changes, the workflow will commit them and push to a new release/x.x.x branch and open a PR for you.

Here's an example PR made by the workflow: #743 The main PR was created by the workflow, but after the fact I did add a few commits just to confirm tests pass.

Example usage

The intended usage is this:

  1. We're ready to start a new release.
  2. Someone manually triggers this action against master branch (could technically be any branch, but master is most common I imagine).
  3. You enter in the new version number (e.g. 5.16.0)
  4. The workflow runs, which preps the code base for the new version (replaces versions/namespaces).
  5. The workflow pushes the changes to a newly created release/5.16.0 (or relevant version) branch.
  6. The workflow auto creates a PR.

Limitation

There's one limitation: the newly created PR will not automatically have tests run against it. When a workflow creates a PR, GitHub does not trigger other workflows that use the "on PR" trigger. This is intentional to prevent against accidental infinite loops. See https://github.com/orgs/community/discussions/65321

There are a few workarounds but they're kind of gross (e.g. use a different GH token in workflows as one example). The simplest way around it is just to manually close and then re-open the PR. That will trigger tests to run lol.

QA

  • Code review

Optional:

  1. Go to the "prep release" GH action: https://github.com/godaddy-wordpress/wc-plugin-framework/actions/workflows/prep-release.yml
  2. Click "Run workflow" in the top right
  3. Make sure you use this branch: feature/prep-release-script . Once this PR is merged you can use any branch, but for now the workflow code only exists in this one!
  4. Enter in any version number greater than 5.15.5 . Do not use 5.16.0 because I already have a branch/PR for that one.
  5. Run the workflow and wait for it to run.
    • Workflow completes successfully
    • A new PR Is created
  6. Manually close and then re-open the PR to trigger tests to run.
    • Tests pass

Before merge

  • I have confirmed these changes in each supported minor WooCommerce version

After merge

@agibson-godaddy agibson-godaddy marked this pull request as ready for review March 5, 2025 10:02
@ajaynes-godaddy
Copy link
Contributor

Neat! 🎉

@ajaynes-godaddy
Copy link
Contributor

ajaynes-godaddy commented Mar 6, 2025

QA checks out. I left one suggestion on formatting of the PR title and description, otherwise looks great!

See #747

Co-authored-by: Drew Jaynes <[email protected]>
Copy link
Contributor

@ajaynes-godaddy ajaynes-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA checks out, see #747.

LGTM!

@agibson-godaddy agibson-godaddy merged commit ae083b6 into master Mar 6, 2025
5 checks passed
@agibson-godaddy agibson-godaddy deleted the feature/prep-release-script branch March 6, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants