Contributing to WP Feature API
May 8, 2025 ยท View on GitHub
Building the Project
-
Clone the repository:
git clone https://github.com/Automattic/wp-feature-api.git cd wp-feature-api -
Install dependencies: This project uses npm workspaces. Dependencies are installed from the root directory.
npm installcomposer install -
Build the project: To build the JavaScript and CSS assets for the plugin and its packages:
npm run build
Release Process
Releasing a new version involves several steps:
-
Ensure the
trunkbranch is stable and all changes for the release are merged. -
Create a Branch and Push Changes: Create a new branch for the release (e.g.,
release/vX.Y.Z).git checkout -b release/vX.Y.Z -
Update Version Numbers: Manually update the version number in the following files to the new version (e.g.,
1.2.3):-
package.json: Update theversionfield.{ "name": "wp-feature-api", "version": "NEW_VERSION_HERE", // ... } -
wp-feature-api.php: Update the version in two places:-
Plugin header comment:
/** * ... * Version: NEW_VERSION_HERE * ... */ -
PHP constant definition:
define( 'WP_FEATURE_API_VERSION', 'NEW_VERSION_HERE' );
-
-
-
Commit Version Bump: Commit these version changes with a message like
Update version to X.Y.Z.git add package.json wp-feature-api.php git commit -m "Update version to X.Y.Z" -
Push Changes: After committing the version bump, push the changes to the remote repository.
git push origin release/vX.Y.Z -
Create a Pull Request: Open a pull request from your
release/vX.Y.Zbranch to thetrunkbranch. -
Merge the Pull Request: Once the pull request is approved, merge it into the
trunkbranch. -
Create and Publish GitHub Release: Once the version bump Pull Request is merged into
trunk:- Go to the "Releases" page in the GitHub UI.
- Click the "Draft a new release" button.
- In the "Choose a tag" dropdown, type your new version tag (e.g.,
v1.2.3). GitHub will offer to "Create new tag: vX.Y.Z on publish". Select this. - Ensure the "Target" is the
trunkbranch. - Enter a "Release title" (e.g.,
Version 1.2.3orv1.2.3). - Write a description for the release. You can list the major changes, or use GitHub's auto-generated release notes feature if available/configured.
- Click "Publish release".
This action will create the new tag from
trunkand trigger the GitHub Actions workflow defined in.github/workflows/release.yml.
-
Verify Release: After the GitHub Actions workflow completes, check the "Releases" page on GitHub to ensure everything completed successfully.