This is an explanation on how a plugin is released on GitHub.
.
└── package.json # Contains scripts to update the different plugin versions
│
└── .changeset
│ └── config.json # Changeset config file
├── .github
│ └── workflows
│ ├── release-branch.yml # Creates the release branch
│ └── release-plugin.yml # Creates the GitHub release
├── plugin
│ └── hwp-previews
│ └── package.json # Required for changeset to work
│ └── wp-graphql-headless-webhooks
│ └── package.json # Required for changeset to work
├── scripts/
│ └── plugin-version
│ ├── previewsVersionPlugin.js # Updates the version of hwp-previews plugin
│ └── webhooksVersionPlugin.js # Updates the version of wp-graphql-headless-webhooks plugin
- A create PR is created for a plugin
- This triggers the changeset bot to check for a changeset.
- A user can add a changeset manually by running
npm run changesetor if they are a maintainer, they can do this also in GitHub - Once the PR is merged the following actions will take place:
This will trigger the release workflow release-branch.yml and the workflow will do the following:
- Check to see if a changeset exists
- Check that a plugin is modified
- Create a release branch for that plugin using `npm run build && changeset publish
- Depending on what plugin is changed it will either run
npm run version:previewsornpm run version:webhookswhich will call a script for updating the plugin version under scripts/plugin-version
After this a plugin release branch is created. See https://github.com/wpengine/hwptoolkit/pulls?q=Plugin+Release
Note
If you are adding a new plugin, you will need to add a script and also update this workflow, along with adding a package.json while updating the main package-lock.json by running npm install
The plugin release branch should contain some updates to the plugin and mainly the plugin version number.
Once approved and merged this will trigger the release-plugin.yml
This will then create a release for the plugin under Github releases