Skip to content

ci: cut releases with release-please - #111

Open
aryanjasala wants to merge 5 commits into
mainfrom
ci/release-please
Open

aryanjasala wants to merge 5 commits into
mainfrom
ci/release-please

Conversation

@aryanjasala

Copy link
Copy Markdown
Member

What this PR does

Moves releases from the manual four-step tag procedure in docs/maintainers.md to release-please, the same flow rtCamp/wp-shared-workflows#45 sets up and rtCamp/plugin-skeleton-d and the One* plugins already use. PR titles become the Conventional Commit subjects on main; release-please keeps one release pull request open that bumps the version and writes CHANGELOG.md, and merging it tags vX.Y.Z for Packagist and publishes the GitHub release.

Closes

N/A

Changes

  • .github/workflows/release.yml runs googleapis/release-please-action v5.0.0 (pinned by SHA) on every push to main. Only that job gets contents, issues and pull-requests: write; the workflow default is contents: read. No alias-tag job: Packagist consumers pin ^2.x, not a moving tag.
  • release-please-config.json (release-type: php) maps commit types to the Keep a Changelog headings this changelog already uses: feat Added, fix Fixed, perf/revert/build Changed; docs, chore, ci, test, refactor and style are hidden and cut no release. composer.json has no version field, so the php strategy leaves it alone. .release-please-manifest.json starts at 2.1.0, the latest tag and GitHub release.
  • .github/workflows/pr-title.yml, the same amannn/action-semantic-pull-request check plugin-elementary already runs.
  • CHANGELOG.md loses the ## [Unreleased] heading and its compare link. release-please inserts each release above the first heading that starts with [ or a digit, so it would have put every new release above [Unreleased]. Old sections and their reference links are untouched.
  • auto-merge.yml squash-merges Dependabot pull requests (--squash instead of --merge); dependabot.yml pins the chore prefix so bumps stay valid titles and cut no release on their own.
  • Docs: docs/maintainers.md "Releasing" now describes the release pull request and gives the title type for each kind of change, including that a new abstract or interface method is feat!: and needs its upgrading.md entry in the same pull request. CONTRIBUTING.md, the PR template and the task issue template drop the [Unreleased] entry and the release/<milestone> branch flow.
  • .gitattributes export-ignores the two release-please files from the Composer dist.

How I verified

  • actionlint and yamllint pass on the new and changed workflows; both JSON files parse.
  • Ran release-please 17.11.2's own Changelog updater against the new CHANGELOG.md: a sample 9.8.7 section lands directly above ## [2.1.0].
  • Commits since v2.1.0 on main: none, so the first run after merge opens no release pull request.

Acceptance criteria

Runtime behavior

  • After merge, the Release run passes and opens no release pull request (nothing releasable since v2.1.0)
  • The first feat: or fix: merge opens a release pull request with the right version

Code quality

  • Lint: actionlint, yamllint zero errors
  • Static analysis: n/a
  • Tests pass (no PHP changed)

Housekeeping

  • No hand-written CHANGELOG.md entry: release-please writes it

Reviewer notes

Repository settings to change when this merges (they are not in the diff):

  • Allow squash merging only, with the default commit title set to the pull request title (PR_TITLE), and squash-only in the main ruleset's allowed merge methods too.
  • Settings > Actions > General: allow GitHub Actions to create pull requests.
  • Keep "Validate PR title" out of the required checks. The release pull request is opened with GITHUB_TOKEN, which starts no workflow runs, so a required check would block every release. A GitHub App token in release.yml would fix that later.

Other notes:

  • release-please creates lightweight tags, where the old procedure used annotated ones. Packagist reads both.

  • New sections use release-please's heading style, ## [2.2.0](compare-url) (date), so the file mixes it with the older ## [2.1.0] - date headings. Nothing parses these headings today.

  • .github/release.yml (generated-notes categories) is no longer used for releases, since release-please writes the notes. Left in place; chore: add issue forms, CODEOWNERS, labels and release notes categories #110 edits it too.

  • There is no security section: the title check doesn't accept a security: type, so security fixes are titled fix(security): and land under Fixed.

  • Repository settings before merging: "Allow GitHub Actions to create and approve pull requests" is off in this repository today, so release-please could not open its release PR. Turn it on (Settings, Actions, General), allow squash merging only, and set the squash commit title to the PR title.

  • The title check drops wip mode: that mode posts a commit status, which a fork pull request's read-only token can't write. Keep "Validate PR title" out of the required checks: release PRs are opened with GITHUB_TOKEN, which starts no workflow runs.

  • Overlap with chore: add issue forms, CODEOWNERS, labels and release notes categories #110: chore: add issue forms, CODEOWNERS, labels and release notes categories #110 adds a hand-written entry under ## [Unreleased]; this PR removes that heading, because release-please inserts each release above the first version heading and would leave anything under ## [Unreleased] stranded. Whichever merges second drops chore: add issue forms, CODEOWNERS, labels and release notes categories #110's entry.

  • Packagist picks up the vX.Y.Z tag release-please creates through its GitHub webhook; GitHub's rule that GITHUB_TOKEN events start no workflows doesn't apply to webhooks.

  • .github/release.yml (GitHub's generated-notes config) is left alone here to avoid a conflict with chore: add issue forms, CODEOWNERS, labels and release notes categories #110, which edits it; it is unused once release-please writes the notes and can go in a follow-up.

Merge commits put subjects like "Merge pull request #n" on main, which
release-please cannot read, and the repository moves to squash-only.
Pull request titles become the Conventional Commit subjects on main.
release-please reads them, keeps a release pull request open that bumps
.release-please-manifest.json and writes CHANGELOG.md, and merging it
tags vX.Y.Z for Packagist and publishes the GitHub release.

- release.yml and pr-title.yml (the PR title check is not required: the
  release pull request is opened with GITHUB_TOKEN and gets no runs)
- changelog sections mapped to Keep a Changelog headings
- the [Unreleased] heading goes, since release-please would insert new
  releases above it
- maintainer docs, contributing checklist, PR and task templates follow
  the new flow, including which title type a contract change needs
- the release config is export-ignored from the Composer dist
Dependabot picks its commit style from history unless told. Pinning
chore(deps) keeps its titles valid for the PR title check and keeps
dependency bumps out of release-please's releasable commits.
The title check's wip mode posts a commit status, which a fork pull
request's read-only token can't write, so it now just passes or fails
and needs only pull-requests: read. Both workflows use github.token.
The security changelog section is gone: the title check doesn't accept
a security type, so security fixes are titled fix(security).
Copilot AI balanced review requested due to automatic review settings November 6, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release guidance would remove required CI safeguards for Dependabot, while retaining those checks blocks token-created release PRs because their checks never run.

1 open issue
What changed in this PR

Replaces manual tagging with release-please so Conventional Commit PR titles drive version bumps, changelog entries, and GitHub releases for the Composer package.

Changes:

  • Adds release automation and PR-title validation, starting from version 2.1.0.
  • Aligns Dependabot titles and merging with the squash-based release process.
  • Updates contributor guidance and templates, removes the Unreleased heading, and excludes release configuration from Composer distributions.
File Description
release-please-config.json Configures PHP releases and changelog sections.
docs/​maintainers.md Replaces manual release steps with the release-PR process.
CONTRIBUTING.md Requires Conventional Commit PR titles instead of changelog edits.
CHANGELOG.md Removes Unreleased and explains automated entries.
.release-please-manifest.json Seeds the release version at 2.1.0.
.github/​workflows/​release.yml Adds serialized release-please runs on main.
.github/​workflows/​pr-title.yml Adds Conventional Commit title validation.
.github/​workflows/​auto-merge.yml Uses squash merging for Dependabot updates.
.github/​pull_request_template.md Replaces the changelog checklist item with title guidance.
.github/​ISSUE_TEMPLATE/​task.md Updates branching and PR guidance to target main.
.github/​dependabot.yml Sets dependency-update titles to the chore type.
.gitattributes Excludes release-please configuration from distributions.

Review effort: Balanced

Comment thread .github/workflows/release.yml Outdated
# request tags vX.Y.Z on main and publishes the GitHub release with the changelog entry as notes.
#
# The release pull request is opened with GITHUB_TOKEN, so GitHub starts no workflow runs on it
# (no tests, no PR title check). That is why neither check is a required status check. Switching

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. Nothing is required on main today (no branch protection, no required checks), so the two don't clash yet, but they would the day Test and Measure becomes required. fd43ef4 now says that in the workflow and names the ways out: a GitHub App token, which starts the release PR's checks, or a maintainer pushing an empty commit to the release branch. Leaving this open until we pick one.

auto-merge.yml expects the Test and Measure jobs to be required so a red
Dependabot update can't merge, but a release pull request opened with
GITHUB_TOKEN starts no runs and would wait on them forever. The release
workflow's comment now says so and names the two ways out: a GitHub App
token, or a maintainer pushing an empty commit to the release branch.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Release automation depends on out-of-diff GitHub settings, including disabled Actions PR creation and squash-only merging with PR-title subjects, requiring maintainer confirmation and validation of the first release run.

1 open issue

Review effort: Balanced

@Adi-ty Adi-ty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small doc fixes inline everything else looks good

Comment thread docs/maintainers.md

A `feat!:` also needs its entry in [upgrading.md](upgrading.md) in the same
pull request.
3. When you want to release, review the release pull request: reword entries

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double-check the "reword entries in the release PR" advice here and in CHANGELOG? From what I understand, release-please rebuilds that branch on each run, so a hand edit may get overwritten on the next push and the release notes seem to come from the PR description rather than the file. If that's right, pointing at a BEGIN_COMMIT_OVERRIDE block in the merged PR's description might be safer.

Comment thread docs/maintainers.md

| Change | Title |
| --- | --- |
| Anything breaking in `inc/Contracts/` or in documented behaviour, including a new abstract method or a new interface method | `feat!:` (or a `BREAKING CHANGE:` footer), major |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "(or a BREAKING CHANGE: footer)" part can be dropped as the squashed commit is built from the branch commit messages, so a footer written in the PR description wouldn't reach main.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants