Skip to content

ci(release): Auto-release when proto schemas change on main#260

Merged
armenzg merged 2 commits into
mainfrom
armenzg/ci/automate-release-on-merge
May 14, 2026
Merged

ci(release): Auto-release when proto schemas change on main#260
armenzg merged 2 commits into
mainfrom
armenzg/ci/automate-release-on-merge

Conversation

@armenzg
Copy link
Copy Markdown
Member

@armenzg armenzg commented May 14, 2026

Automate releases on merges to main when the merge includes protobuf schema changes under proto/**, so version bumps and package publishing stay aligned with schema updates.

Scoped auto-release trigger

The release workflow now runs on push to main with a paths filter for proto/**, and uses version=auto by default for push-triggered runs.

Manual override and loop prevention

Manual workflow_dispatch remains available for explicit version/force inputs, and release-generated release: commits are ignored to prevent recursive runs.

README now documents the new trigger scope and the manual dispatch path.

Trigger the release workflow on pushes to main so merged PRs automatically
create the next version with craft. Keep manual dispatch support and skip
release-triggered release commits to avoid recursive runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 14, 2026, 4:13 PM

@armenzg armenzg self-assigned this May 14, 2026
Only trigger push-based releases when changes land under proto/. This keeps
version bumps aligned with schema updates while preserving manual release runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@armenzg armenzg changed the title ci(release): Automate version creation on merged PRs ci(release): Auto-release when proto schemas change on main May 14, 2026
on:
push:
branches:
- main
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.

Execute on pushes on main besides when dispatched via the workflow.

branches:
- main
paths:
- 'proto/**'
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.

We will only do releases if changes happen under proto/

name: 'Release a new version'
if: |
github.event_name == 'workflow_dispatch' ||
!startsWith(github.event.head_commit.message, 'release:')
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.

These lines are a job-level guard that decides whether the release job should run:

  • github.event_name == 'workflow_dispatch'

    • If someone manually triggers the workflow from Actions UI, always run.
  • ||

    • Logical OR.
  • !startsWith(github.event.head_commit.message, 'release:')

    • For push-triggered runs, skip the job when the latest commit message starts with release:.

Why this exists:

  • Your automated release flow creates commits like release: x.y.z.
  • Those commits also land on main and would retrigger the workflow.
  • This check prevents that self-triggering loop.

So in practice: manual runs always execute; push runs execute unless they are release-generated commits.

version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
version: ${{ github.event.inputs.version || 'auto' }}
force: ${{ github.event.inputs.force || 'false' }}
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.

Default to these values if not defined.

@armenzg armenzg marked this pull request as ready for review May 14, 2026 16:14
@armenzg armenzg requested a review from a team May 14, 2026 16:14
Copy link
Copy Markdown
Contributor

@noahsmartin noahsmartin left a comment

Choose a reason for hiding this comment

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

Thank you!

@armenzg armenzg merged commit 14b70f9 into main May 14, 2026
14 checks passed
push:
branches:
- main
paths:
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.

Hello world!

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.

2 participants