Skip to content

ci: release via PR instead of direct push to main#570

Closed
tolzhabayev wants to merge 1 commit intomainfrom
chore/release-via-pr
Closed

ci: release via PR instead of direct push to main#570
tolzhabayev wants to merge 1 commit intomainfrom
chore/release-via-pr

Conversation

@tolzhabayev
Copy link
Copy Markdown
Contributor

@tolzhabayev tolzhabayev commented May 8, 2026

Summary

The org-level "Public repo required PRs" ruleset (id 15595097) blocks direct pushes to main, which broke the existing release flow — see failed run https://github.com/grafana/plugin-validator/actions/runs/25546676728.

This PR splits the release into two stages so it works under the new policy:

  • do-release.yml (workflow_dispatch, unchanged trigger): bumps the version on a release/bump-vX.Y.Z branch and opens a PR. No tag, no main push.
  • tag-on-version-bump.yml (new, triggers on push to main with package.json change): if package.json's version differs from the previous commit and the corresponding vX.Y.Z tag doesn't already exist, create and push the tag. The tag push triggers the existing release.yml, which publishes the GitHub Release, the npm package, and the Docker image.

Tag pushes aren't blocked by the org ruleset (it targets branch refs only), so step 2 works under the existing rules.

HOW_TO_RELEASE.md is updated to reflect the new step (review and squash-merge the auto-PR).

Notes

  • do-release-mcp.yml has the same problem and will need an analogous fix. Out of scope for this PR.
  • This change does not modify any rulesets.

Test plan

  • Merge this PR.
  • Dispatch the Bump Version and release workflow with version=patch.
  • Verify a release/bump-v0.41.1 branch and matching PR are created automatically.
  • Squash-merge that PR.
  • Verify Tag on version bump runs and pushes v0.41.1.
  • Verify Create release and publish triggers and publishes the GitHub Release, npm, and Docker image.

The org-level "Public repo required PRs" ruleset blocks direct pushes
to main, so the previous flow (commit + tag pushed straight to main
from the workflow) fails. Split the release into two stages:

- do-release.yml: bump version on a release branch and open a PR.
- tag-on-version-bump.yml: when main receives a package.json version
  change (e.g. via the merged release PR), create and push the v* tag,
  which triggers the existing release pipeline.

Tag pushes are not blocked because the ruleset targets branches only.

do-release-mcp.yml has the same issue and will be addressed separately.
@tolzhabayev tolzhabayev requested review from a team as code owners May 8, 2026 09:06
@tolzhabayev tolzhabayev requested a review from sunker May 8, 2026 09:06
@tolzhabayev tolzhabayev requested review from s4kh and xnyo May 8, 2026 09:06
@tolzhabayev tolzhabayev self-assigned this May 8, 2026
@tolzhabayev tolzhabayev requested a review from academo May 8, 2026 09:06
@grafana-plugins-platform-bot grafana-plugins-platform-bot Bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team May 8, 2026
@tolzhabayev
Copy link
Copy Markdown
Contributor Author

Superseded by #571, which migrates releases to release-please instead of layering a custom branch+PR workflow. See that PR for the full rationale and the alignment with grafana/plugin-ci-workflows / grafana/plugin-actions conventions.

@tolzhabayev tolzhabayev closed this May 8, 2026
@tolzhabayev tolzhabayev deleted the chore/release-via-pr branch May 8, 2026 09:49
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🚀 Shipped in Grafana Catalog Team May 8, 2026
tolzhabayev added a commit that referenced this pull request May 8, 2026
The previous release flow (do-release{,-mcp}.yml → push commit + tag to
main from a workflow) is blocked by the org-level "Public repo required
PRs" ruleset. Replace the bespoke machinery with release-please, matching
the convention already used in grafana/plugin-ci-workflows and
grafana/plugin-actions.

- Add release-please-config.json with two packages (root → plugin-validator,
  mcp-package → mcp); bootstrap-sha pins the root changelog start to the
  v0.41.0 commit so the first release PR doesn't enumerate all of history.
- Add .release-please-manifest.json with current versions.
- Add .github/workflows/release-please.yml; on push to main it opens /
  updates per-package release PRs and on merge creates the tag + GitHub
  Release with the changelog body.
- Update release.yml to trigger on plugin-validator/v[0-9]* tags and pass
  RELEASE_VERSION (semver only) into goreleaser.
- Update .goreleaser.yaml archives.name_template to use RELEASE_VERSION;
  needed because the new tag contains a "/" which would otherwise pollute
  the default {{ .Version }} archive name.
- Update package.json binWrapper urlTemplate for the new download path.
- release-mcp.yml + .goreleaser.mcp.yaml unchanged: release-please produces
  mcp/v* tags that already match the existing trigger and MCP_VERSION
  extraction.
- GoReleaser default release.mode is keep-existing, which preserves the
  body release-please writes on the GitHub Release.
- Delete do-release.yml and do-release-mcp.yml.
- Rewrite HOW_TO_RELEASE.md for the conventional-commit-driven flow.

Supersedes #570.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

1 participant