Files
wp-asciiplayer/docs/releases.md
T

39 lines
3.3 KiB
Markdown

# Preparing a GitHub release
Push a SemVer tag after the release commit has been merged into `main`. The CI workflow validates the tag, builds the installable ZIP, and runs the PHP and WordPress/browser test matrices. Only then does it create an **unpublished GitHub Release draft**, with generated release notes, the ZIP, and its SHA-256 checksum. Review and publish the draft yourself.
No WordPress.org upload or deployment is performed.
## Before tagging
Use one exact version in these places:
- `package.json`: `version`
- `package-lock.json`: top-level `version` and `packages[""].version`
- `block.json`: `version`
- `asciicast-player.php`: plugin `Version` header and `VERSION` constant
- `readme.txt`: `Stable tag`
Then run `npm run build`, `npm test`, and `npm run package`. Commit the metadata and regenerated translation artifacts, and merge the changes into `main` before creating the tag. The workflow never bumps versions, rewrites a tag, or commits generated files for you.
For example, a tag `v1.2.3` requires `1.2.3` in every metadata field. Both `v1.2.3` and bare `1.2.3` are accepted; choose one convention and use it consistently. Leading zeroes such as `v01.2.3` are invalid. Prerelease and build identifiers are supported, for example `v1.2.3-rc.1+build.5`, with that exact version (without the `v`) in the metadata.
A prerelease tag creates a draft marked as a GitHub prerelease. Build metadata alone does not mark a prerelease. `readme.txt` is checked for consistency inside the ZIP; this workflow does not change WordPress.org's Stable Tag or its distribution rules. Do not treat a GitHub prerelease draft as a WordPress.org stable release.
## What the workflow checks
- Tags are checked against the full SemVer grammar, not just GitHub's tag glob.
- The tagged commit must already be included in `main`.
- Tag and plugin metadata must agree exactly. A stable tag cannot release files that still contain a development version.
- Both PHP compatibility jobs and both WordPress integration jobs must pass. Plugin Check keeps its existing advisory treatment for directory-review findings.
- The release job downloads the immutable artifact ID from the build job. It never uses a copy mounted into WordPress or Plugin Check.
- Only the final draft job has repository write permission. It installs no npm dependencies and never publishes a release.
## Notes and reruns
Release notes are generated by GitHub from the previous suitable published SemVer release. Stable releases exclude prerelease predecessors; prereleases may use an earlier prerelease. The predecessor must also be an existing tag reachable from the release commit. With no suitable predecessor, the workflow lists commits reachable from the tagged commit instead of letting GitHub choose an unrelated comparison base. Review the generated text before publishing.
Rerunning the tag workflow resumes its matching draft rather than creating another one. An already published release is left untouched. Existing assets must match the expected bytes; conflicting assets or an unrelated draft cause a clear failure instead of being overwritten. If you edit the draft manually, keep its provenance marker so a rerun can recognize it.
Use a new version/tag for different source code. Do not move an existing release tag to repair a failed run. Normal branch and pull-request CI never creates a release draft.