Skip to content

ci: auto-tag + GitHub release on plugin version merges#26

Merged
zackkatz merged 1 commit into
mainfrom
develop
Jun 12, 2026
Merged

ci: auto-tag + GitHub release on plugin version merges#26
zackkatz merged 1 commit into
mainfrom
develop

Conversation

@zackkatz

@zackkatz zackkatz commented Jun 12, 2026

Copy link
Copy Markdown
Member

Merging a plugin version bump to main now performs the whole release — no manual tagging:

  • build-plugin-zip.yml (main-push path) reads the plugin Version header; when v{version} has no tag yet, it creates the tag + GitHub release with that version's readme.txt Upgrade Notice as the body and gk-block-mcp.zip attached.
  • Created inside the build job because GITHUB_TOKEN-pushed tags don't trigger workflows — a separate tagging workflow would never fire the release build.
  • Idempotent: existing tags skip (this PR's own merge run should log "v2.0.1 is already tagged — nothing to release"). Manual v* tag pushes remain a backstop.
  • With npm-publish.yml keying off package.json independently, GitHub and npm releases ship in sync from one merge while the plugin and MCP server keep versioning separately.
  • AGENTS.md Versioning & Releases updated to document the automated flow.

Validated: YAML parses; version + Upgrade Notice extraction tested against the real files (yields 2.0.1 and the 2.0.1 notice paragraph).

Summary by CodeRabbit

  • Chores

    • Implemented automated GitHub release creation with version detection when merging to the main branch.
  • Documentation

    • Updated release process documentation to reflect the automated release workflow.

💾 Build file (f02f855).

…erges

Merging a plugin version bump to main is now the release: the zip build
detects an unreleased plugin Version header and creates the v{version}
tag + GitHub release with the readme.txt Upgrade Notice as the body and
the ZIP attached. The release is created inside the build job because
tags pushed with GITHUB_TOKEN don't trigger other workflows — a tag-push
hop would never fire the release build. Manual v* tag pushes remain a
backstop. Together with npm-publish.yml (which keys off package.json
independently), GitHub and npm releases now ship in sync from one merge.

Documents the automated flow in AGENTS.md (Versioning & Releases).
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The pull request automates plugin releases on merge to main. A new workflow step detects the plugin version from the PHP file header and extracts release notes from readme.txt, then conditionally creates a GitHub release with the plugin ZIP if the version is unreleased. The agent documentation is updated to reflect this automated process.

Changes

Automated Plugin Release on Main Merge

Layer / File(s) Summary
Version detection and GitHub release creation
.github/workflows/build-plugin-zip.yml
New workflow steps read the plugin version from gk-block-mcp.php, check for an existing v{version} tag, extract "Upgrade Notice" from readme.txt as release notes, and conditionally create the GitHub release with the attached plugin ZIP when the version is unreleased.
Release workflow documentation
AGENTS.md
Documentation updated to describe the merge-to-main automated release process driven by the updated build-plugin-zip.yml workflow and the existing npm-publish.yml workflow, replacing the previous manual tagging description.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci: auto-tag + GitHub release on plugin version merges' directly and specifically describes the main change: automated tagging and GitHub release creation triggered by plugin version merges to main.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
.github/workflows/build-plugin-zip.yml (1)

149-157: 📐 Maintainability & Code Quality | 💤 Low value

Consider using gh release create directly (optional simplification).

The workflow currently uses softprops/action-gh-release. The static analysis tool suggests using the built-in GitHub CLI (gh release create) instead, which would reduce third-party action dependencies and use runner-native tooling. The current approach is perfectly fine and well-tested, so this is purely an optional simplification.

Example alternative:

- name: Create tag + release for the new version (push to main)
  if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.plugin_version.outputs.unreleased == 'true'
  env:
    GH_TOKEN: ${{ github.token }}
  run: |
    gh release create "v${{ steps.plugin_version.outputs.version }}" \
      --title "v${{ steps.plugin_version.outputs.version }}" \
      --notes-file "${{ runner.temp }}/release-notes.md" \
      gk-block-mcp.zip
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-plugin-zip.yml around lines 149 - 157, The workflow
step named "Create tag + release for the new version (push to main)" currently
uses softprops/action-gh-release; to simplify and remove the third-party action,
replace that step with a run step that invokes the GitHub CLI `gh release
create` using the existing `steps.plugin_version.outputs.version` for tag/title,
`runner.temp`/release-notes.md for notes, and include the artifact
`gk-block-mcp.zip`; ensure you set env GH_TOKEN=${{ github.token }} so `gh` is
authenticated and preserve the same conditional `if: github.event_name == 'push'
&& github.ref == 'refs/heads/main' && steps.plugin_version.outputs.unreleased ==
'true'`.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/build-plugin-zip.yml:
- Around line 149-157: The workflow step named "Create tag + release for the new
version (push to main)" currently uses softprops/action-gh-release; to simplify
and remove the third-party action, replace that step with a run step that
invokes the GitHub CLI `gh release create` using the existing
`steps.plugin_version.outputs.version` for tag/title,
`runner.temp`/release-notes.md for notes, and include the artifact
`gk-block-mcp.zip`; ensure you set env GH_TOKEN=${{ github.token }} so `gh` is
authenticated and preserve the same conditional `if: github.event_name == 'push'
&& github.ref == 'refs/heads/main' && steps.plugin_version.outputs.unreleased ==
'true'`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28cb80a4-5ea7-4ae7-aeb1-586ce58e93de

📥 Commits

Reviewing files that changed from the base of the PR and between f0de697 and f02f855.

📒 Files selected for processing (2)
  • .github/workflows/build-plugin-zip.yml
  • AGENTS.md

@zackkatz zackkatz merged commit 17fbc42 into main Jun 12, 2026
9 checks passed
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.

1 participant