Skip to content

ci: create GitHub release after publishing to Maven Central - #62

Merged
alexgerardojacinto merged 2 commits into
mainfrom
chore/RMET-5634/create-github-release-on-publish
Nov 25, 2026
Merged

alexgerardojacinto merged 2 commits into
mainfrom
chore/RMET-5634/create-github-release-on-publish

Conversation

@alexgerardojacinto

Copy link
Copy Markdown
Collaborator

Summary

The "Publish Native Android Library" workflow now creates the GitHub tag and release itself, right after the library is published to Maven Central, so the release no longer has to be created by hand.

  • scripts/publish-android.sh: after Success: Published to MavenCentral., writes published=true and version to $GITHUB_OUTPUT. The existing "Duplicate ... skipping" path is unchanged, so a re-run for an already-published version does nothing.
  • .github/workflows/publish-android.yml: contents: read -> contents: write, and a new Create GitHub release step that:
    • only runs when this run actually published a new version, and only from main or next;
    • creates the tag and release named <version> (same naming as the existing tags, no v prefix) on the commit that was built ($GITHUB_SHA);
    • uses the matching CHANGELOG.md section as release notes, falling back to GitHub's generated notes when there is none;
    • marks versions containing - (e.g. 3.0.0-alpha.1) as pre-releases;
    • skips if a release for that version already exists.

Notes

  • The release is created after the script reports success, which is when Central accepts the upload. A validation failure on the Central Portal after that would still leave a release behind, so it is still worth checking the artifact shows up on Maven Central.
  • Same change applied to the other native Android library repos.

Test plan

  • Workflow YAML and publish-android.sh syntax validated locally
  • CHANGELOG section extraction checked against existing and upcoming versions
  • Verify on the next real publish (nothing to test earlier, since the workflow only runs on manual dispatch)

@alexgerardojacinto
alexgerardojacinto requested a review from a team as a code owner November 24, 2026 13:05
@alexgerardojacinto
alexgerardojacinto requested review from a team, andredestro and markemer and removed request for a team November 24, 2026 13:05
Comment thread .github/workflows/publish-android.yml Resolved
working-directory: ./scripts
run: ./publish-android.sh No newline at end of file
run: ./publish-android.sh
- name: Create GitHub release

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit, not blocking: could the release go in its own job (needs: publish-android) so only that job gets contents: write? The Gradle build would keep a read-only token, and a failed release could be retried with "Re-run failed jobs". Same applies to the other PRs in this batch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I think we could do that

@alexgerardojacinto

Copy link
Copy Markdown
Collaborator Author

Good catch, thanks. Switched the version headings in CHANGELOG.md from # to ## (91465fa), matching the other repos. The awk now finds the 2.1.2 section, so the release will use the CHANGELOG notes instead of the generated fallback.

Leaving the separate release job out of this PR: the other PRs in this batch are already merged, so I'd rather keep them consistent.

@alexgerardojacinto
alexgerardojacinto merged commit 11a29a6 into main Nov 25, 2026
7 checks passed
@alexgerardojacinto
alexgerardojacinto deleted the chore/RMET-5634/create-github-release-on-publish branch November 25, 2026 13:04
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