Skip to content

Release on merging a release PR from staging into master - #326

Merged
arifBurakDemiray merged 1 commit into
stagingfrom
release-on-merge
Oct 23, 2026
Merged

arifBurakDemiray merged 1 commit into
stagingfrom
release-on-merge

Conversation

@arifBurakDemiray

Copy link
Copy Markdown
Member

What

Merging a staging to master PR labelled release now releases the SDK: no GitHub release is created by hand any more. It lands dark: nothing happens on merge until the repository variable RELEASE_ON_MERGE is true.

When release-on-merge.yml does
The release label is on an open staging to master PR Runs release.py pending as the Release plan check: the tags the merge will create, or why the release would be refused
That PR is merged Plans again on the merge commit, then for each tag (core first): creates the GitHub release on the PR's head commit with its changelog section as notes, and dispatches release.yml on the tag

Changes to the existing release path:

  • Announcement: gated by the plan's pre-release output instead of the release event, and reading the notes with gh, so a dispatched run announces too. A new optional requested_by input names the person who merged the release PR instead of github-actions[bot].
  • Version check: check-sources now also refuses a final release whose changelog still has a ## XX.XX.XX heading, for releases published by hand too.
  • A release published by hand still starts release.yml as before.

Design and decisions: Java SDK release automation.

What pending refuses

Nothing is created when any of these holds:

  • The merge commit does not contain the PR's head (a squash or rebase merge), or its tree differs from the head's (master holds changes staging lacks).
  • A version source disagrees with the others, or a changelog is missing.
  • A final release's changelog has no ## X.Y.Z section, or still has ## XX.XX.XX.

A tag that exists is skipped, so a merge with no new version releases nothing. Only the plain version tag of a final release is marked latest; a -rcN version becomes a GitHub pre-release.

Before turning it on

  1. Tag ui-26.8.0 on c180b24, the 26.8.0 commit: ly.count.sdk:java-ui:26.8.0 shipped with it (it is on Maven Central) but never got its own tag. Without the tag, the first release PR's check asks to release UI 26.8.0.
  2. Create the release label, and consider making Release plan a required check on master.
  3. The production setup release.yml already needs: the maven-release environment with required reviewers and tag rules, and maven.countly.com.
  4. Merge master into staging (Group CodeQL action updates in one Dependabot PR #316's two commits are only on master), or the tree check refuses the release PR.
  5. Set RELEASE_ON_MERGE to true.

Verified

  • Release tool tests: 84 of 84, among them pending for new, tagged and not-ready versions, release candidates, the merge checks, changelog sections with code blocks and CRLF, and the CLI end to end in a throwaway git repository.
  • actionlint 1.7.12 and zizmor 1.30.1, the versions of the Release workflow lint job: no findings on the three workflows.
  • pending on this repository with the core bumped to 26.9.0 and a local ui-26.8.0 tag: plans 26.9.0 only, marked latest, with the 55-line changelog section as notes; with the heading still ## XX.XX.XX it fails and says why.

Not covered by a test

Creating the releases, the dispatch and the announcement run only on a real merge. Watch the first one; the publish approval of maven-release is still the last gate, and the run summary says how to finish a release by hand if a step fails.

🤖 Generated with Claude Code

A staging to master PR labelled release creates the GitHub release of
every version without a tag, on the PR's head commit with its changelog
section as notes, then starts the Release workflow on each tag. While the
label is on an open PR, the same plan runs as a check. Releasing on merge
stays off until the RELEASE_ON_MERGE repository variable is true.

- release.py pending plans the releases of a merge, after checking that
  the merge commit holds exactly the PR's head.
- The announcement reads the GitHub release, so a dispatched run
  announces too, naming who merged the release PR.
- Changelog headings are read in one place, which skips '## ' lines in
  code blocks; a missing changelog is reported instead of crashing.
@github-actions

Copy link
Copy Markdown

Dependency security scan

Scanned 25 resolved dependencies, failing on HIGH and above.

No known vulnerabilities in 25 resolved dependencies.

Result: passed

Full run log

@github-actions

Copy link
Copy Markdown

Unit Test Results 🚀

739 tests  ±0   739 ✅ ±0   2m 50s ⏱️ ±0s
 64 suites ±0     0 💤 ±0 
 64 files   ±0     0 ❌ ±0 

Results for commit 72523fc. ± Comparison against base commit a261452.

@github-actions

Copy link
Copy Markdown

Code coverage

module lines branches
sdk-java 89.8% (7234/8054) 80.1% (3203/4000)
sdk-java-ui 70.5% (968/1374) 63.2% (499/790)
Least covered classes (10 shown)
class module lines covered uncovered
ly.count.sdk.java.ui.JavaFxContentDisplay sdk-java-ui 10.6% (23/216) 193
ly.count.sdk.java.ui.FxSurfaces sdk-java-ui 74.8% (172/230) 58
ly.count.sdk.java.ui.ExternalBrowser sdk-java-ui 55.0% (66/120) 54
ly.count.sdk.java.internal.SDKCore sdk-java 89.0% (363/408) 45
ly.count.sdk.java.ui.JavaFxWidgetHost sdk-java-ui 81.2% (190/234) 44
ly.count.sdk.java.internal.ModuleRequests sdk-java 75.9% (132/174) 42
ly.count.sdk.java.internal.ModuleContent sdk-java 89.7% (280/312) 32
ly.count.sdk.java.internal.TimedEvents sdk-java 60.8% (48/79) 31
ly.count.sdk.java.internal.SessionImpl sdk-java 90.1% (274/304) 30
ly.count.sdk.java.internal.SDKStorage sdk-java 84.5% (158/187) 29

Full run log

@arifBurakDemiray
arifBurakDemiray marked this pull request as ready for review October 23, 2026 08:51
@arifBurakDemiray
arifBurakDemiray merged commit 878947f into staging Oct 23, 2026
17 checks passed
@arifBurakDemiray
arifBurakDemiray deleted the release-on-merge branch October 23, 2026 08:52
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