wp-parsely
wp-parsely copied to clipboard
Add GitHub Action for Build and Release
Description
Since now we're using composer autoloading, we need to build a classmap during the release process. This PRs adds a new Build and Release action that will do the following:
- Checkout and Prepare: The workflow begins by checking out the specified branch or reference and preparing the "built" branch. If the "built" branch doesn't exist, it creates one from the "develop" branch.
- Git Configuration: Configures Git with a user name and email for the GitHub Actions bot to commit changes.
- Merge Branches: Merges the current branch into the "built" branch using a squash merge, committing the result.
-
Read and Use Node Version: Reads the Node.js version from the
.nvmrc
file and sets it up usingsetup-node
. -
Build the Project: Installs dependencies using
npm
and Composer, runs the build process, and optimizes Composer autoloading. - Check for Changes: Lists all changed files in the working directory.
- Commit Built Files: Adds the changes, commits them with a versioned message, and pushes the updates to the "built" branch.
-
Tag and Release: The next job tags the commit with the version from
package.json
, extracts and formats the relevant section fromCHANGELOG.md
, and creates a draft release on GitHub with the changelog details. - Deploy to WordPress.org: The final job deploys the built plugin to WordPress.org using the versioned tag and updates the GitHub release with the ZIP file generated during deployment.
Motivation and context
- Improve the release process, especially now that we have built-time dependencies.
How has this been tested?
This was tested on #2622
Summary by CodeRabbit
-
New Features
- Introduced an automated workflow for building, tagging, releasing, and deploying the WordPress plugin.
- Improved consistency and efficiency in the release process.
-
Chores
- Updated CI/CD pipeline to enhance the deployment of plugin updates to WordPress.org.