بنقرة واحدة
release
// Build and publish a GitHub Release for the WooCommerce Fraud Protection plugin. Use when creating a new release.
// Build and publish a GitHub Release for the WooCommerce Fraud Protection plugin. Use when creating a new release.
Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow.
Guidelines for git and GitHub operations in the WooCommerce repository.
Guidelines for creating and modifying markdown files in WooCommerce. Use when writing documentation, README files, or any markdown content.
| name | release |
| description | Build and publish a GitHub Release for the WooCommerce Fraud Protection plugin. Use when creating a new release. |
| user_invocable | true |
| arguments | [{"name":"version","description":"Version to release (e.g., 0.1.3). If omitted, propose the next version from the latest git tag and ask the user to confirm.","required":false}] |
Bump the version, build the plugin zip, ship a release PR, and create a GitHub Release once it merges.
version (optional): target version like 0.1.3. If omitted, propose the next patch bump from the latest v* git tag and confirm with the user before proceeding.Pick the target version
package.json and the latest v* git tag (git tag --list 'v*' | sort -V | tail -1).{{version}}, use it. Otherwise propose the next patch bump and confirm.Gather commits since the last release
git log v<last>..HEAD --no-merges --oneline on trunk to see what landed.gh pr view <num> --json title,body) to understand intent.Bump version in three locations (all must match the target version):
woocommerce-fraud-protection.php plugin header (Version:)woocommerce-fraud-protection.php constant (WC_FRAUD_PROTECTION_VERSION)package.json (version)Apply changelog framing rules to every candidate bullet. This is a public release; bullets must be appropriate for a public audience. Consult with the user before continuing.
Draft the changelog.txt entry following step 4's rules and show it to the user for review before continuing.
YYYY-MM-DD - version <version> heading followed by * Added|Updated|Fixed - ... bullets, matching prior entries.YYYY-MM-DD form, not a planned rollout date.Run checks locally (parallel where possible):
npm run lint -- --ignore='*/sdd/*' # phpcs picks up the untracked sdd/ scratch dir locally
npm run test:js # skip npm run test:php; PHP unit tests run on CI
npm run phpstan
sdd/, those are local scratch files (gitignored). Confirm product code is clean by re-running with --ignore='*/sdd/*'.Build the zip:
npm run build:release
Confirm woocommerce-fraud-protection.zip was created. Detailed content verification happens in step 8.
Verify the zip's contents before shipping.
woocommerce-fraud-protection/ directory. Expected files:
woocommerce-fraud-protection-loader.phpwoocommerce-fraud-protection.phpchangelog.txtassets/js/*.jssrc/**/*.phpvendor/autoload.php and vendor/composer/* (PSR-4 autoloader; required at runtime - bootstrap requires it)unzip -p woocommerce-fraud-protection.zip woocommerce-fraud-protection/woocommerce-fraud-protection.php | grep -E "Version:|WC_FRAUD_PROTECTION_VERSION"
unzip -p woocommerce-fraud-protection.zip woocommerce-fraud-protection/changelog.txt | head -3
node_modules/, missing vendor/). Stop and ask the user before continuing if anything is off.Open a release PR (do NOT push the bump commit directly to trunk):
release/<version> from trunk.Fraud Protection: Bump version to <version> (stage only woocommerce-fraud-protection.php, package.json, changelog.txt - never sdd/).git push -u origin release/<version>.gh pr create --base trunk --head release/<version> including the changelog bullets in the body and a short test plan.After merge, pull trunk and rebuild:
git switch trunk && git pull --ff-only origin trunk
npm run build:release
Re-run step 8 on the rebuilt zip (the merged commit may differ from the PR-branch commit).
Create the GitHub Release:
gh release create "v<version>" \
woocommerce-fraud-protection.zip \
--title "v<version>" \
--notes "<changelog bullets for this version, verbatim from changelog.txt>"
Verify with gh release view v<version> that:
isDraft: false, isPrerelease: falsewoocommerce-fraud-protection.zip asset uploaded successfullyrelease/<version> branch (git branch -d release/<version>) since the remote branch is deleted on merge.trunk. Always go through a release/<version> PR so CI runs against the release commit.sdd/ directory is local-only and gitignored. Never stage it; ignore it during phpcs.vendor/ belongs in the zip. The bootstrap requires vendor/autoload.php. If the build excludes it, the plugin will fatal on load.YYYY-MM-DD form, not a future or rollout-planned date.