woocommerce/tools/package-release
Christopher Allford 758df4854d
Use `ci-jobs` Utility For `ci.yml` Matrix (#43532)
This adds support for using the `pnpm utils ci-jobs` command in our `ci.yml` file. One of the bigger benefits to this change too is that we're now distributing a bundled version of the utils tool. This lets us run it without actually having to install the repo and will let us speed up any workflows that currently do.
2024-01-12 20:32:14 -08:00
..
bin Package release script: Prepare packages (#33515) 2022-06-23 12:09:43 +12:00
src add composer install to package prepare script (#42839) 2023-12-15 11:08:29 -04:00
.eslintignore Package release script: Prepare packages (#33515) 2022-06-23 12:09:43 +12:00
.eslintrc Package release script: Prepare packages (#33515) 2022-06-23 12:09:43 +12:00
README.md Package release: Handle new package validation (#39008) 2023-06-29 13:28:19 +12:00
package.json Use `ci-jobs` Utility For `ci.yml` Matrix (#43532) 2024-01-12 20:32:14 -08:00
tsconfig.json Improve experimental select control accessibility (#34510) 2022-09-20 14:29:27 -07:00

README.md

Releasing Javascript packages

When a package contains sufficient changes to justify a release to NPM, follow these instructions to create a new release from the monorepo.

Below are instructions for releasing using Github Workflows (recommended) and the command line. When releasing packages for the first time, release from the command line.

Prepare packages

In order to prepare a package for release, a changelog will need to be compiled along with an appropriate version bump.

  1. Visit the monorepo Action Prepare Package Release workflow. Click the "Run workflow" button.

image

  1. Select the branch you'd like to release from. Typically, this would be trunk. You can also choose which packages to prepare for release by supplying them as comma separated values in the input box. To loop through all packages, simply leave the -a flag. Packages that don't have any changes will be skipped and left as is.

image

  1. Once the action has finished, check open pull requests for a pull request generated by Github Actions Bot. This pull request should include version bumps and changelog changes for applicable packages. Approve and merge the pull request once checks pass.

Release Packages

  1. Release the packages to NPM by kicking off another workflow. The Packages Release workflow has the same inputs as the prepare workflow. Be sure to release from the same branch and select the same packages to release.

image

  1. Confirm the package has been updated by visiting NPM. For example see https://www.npmjs.com/package/@woocommerce/components.

Release packages using the command line

Prepare packages

  1. At monorepo root, run the following command to prepare all packages. Instead of the -a flag, you can pass in a list of packages separated by commas.
./tools/package-release/bin/dev prepare -a

When making an initial release for a new package, pass the --initial-release flag to signify a new release for a new package.

  1. Create a pull request with the resulting changes and merge it.

See more about the prepare script using ./tools/package-release/bin/dev publish --help.

Release Packages

  1. Pull down the latest commits from Github.

  2. Run the release script from monorepo root, first as a dry run.

When making an initial release for a new package, pass the --initial-release flag to signify a new release for a new package.

./tools/package-release/bin/dev publish -a --dry-run
  1. Run the release for real this time.
./tools/package-release/bin/dev publish -a

See more about the publish script using ./tools/package-release/bin/dev publish --help.