Skip to content

Add SDK release actions - #78

Merged
IgorDobryn merged 4 commits into
masterfrom
sdk-release-actions
Nov 11, 2026
Merged

IgorDobryn merged 4 commits into
masterfrom
sdk-release-actions

Conversation

@IgorDobryn

@IgorDobryn IgorDobryn commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Mailtrap SDKs (public mailtrap org) are moving their publish step from a private shared workflow into each SDK repo. Private repos can't share actions across orgs, so the release helpers move here, next to the draft-release actions (compute-next-semver, prepend-changelog, open-sdk-release-pr).

Changes

  • resolve-pending-release (new): reads the newest ## [X.Y.Z] heading in CHANGELOG.md and reports whether a draft GitHub Release exists for it, so a release workflow triggered on push can skip ordinary pushes. tag-prefix covers repos with bare X.Y.Z tags
  • check-sdk-github-release, check-sdk-npm-release, check-sdk-rubygems-release: fail early when the release is not a draft or the version is already on the registry
  • publish-github-release: un-drafts a release; optional target pins it to the built commit first
  • repo / github-token default to the current repository and github.token, as in abort-if-tag-exists
  • actions/github-script pinned to a commit SHA, since these run in jobs that can publish

How to test

  • resolve-pending-release@sdk-release-actions in a repo whose top changelog version has a draft release → pending=true; published release → pending=false
  • Bad token or unknown repo → the step fails instead of reporting pending=false
  • publish-github-release with target on a throwaway draft → tag created at that commit

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03f6cfac-a0bc-4654-a9db-357078ff84bc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@IgorDobryn IgorDobryn changed the title Port SDK related workflows Add SDK release actions Nov 9, 2026
@IgorDobryn
IgorDobryn requested a balanced review from Copilot November 9, 2026 09:51

Copilot AI 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.

🟡 Changes recommended

The release checks suppress unexpected npm registry failures and treat non-version changelog headings as release versions, allowing releases to proceed without availability confirmation or causing pending drafts to be missed.

2 open issues
What changed in this PR

Adds reusable release actions so public Mailtrap SDK repositories can manage publishing without relying on a private cross-organization workflow.

Changes:

  • Detect pending draft releases from changelog versions.
  • Add GitHub, npm, and RubyGems release preflight checks.
  • Support publishing GitHub releases with an optional target commit and document the new actions.
File Description
resolve-pending-release/​action.yml Resolves the latest changelog version and checks for a matching draft release.
README.md Lists and links the SDK release actions.
publish-github-release/​action.yml Publishes a draft release, optionally setting its target commit first.
check-sdk-rubygems-release/​action.yml Checks whether a gem version is already published.
check-sdk-npm-release/​action.yml Checks whether an npm package version is already published.
check-sdk-github-release/​action.yml Requires a draft GitHub release for the supplied tag.

Review effort: Balanced

Comment thread check-sdk-npm-release/action.yml Resolved
Comment thread resolve-pending-release/action.yml Resolved
@IgorDobryn
IgorDobryn requested review from Rabsztok and izikaj November 9, 2026 11:00
@IgorDobryn
IgorDobryn marked this pull request as ready for review November 9, 2026 11:00
@IgorDobryn

Copy link
Copy Markdown
Collaborator Author

Follow-up from mailtrap/mailtrap-php#90 review: publish-github-release should fail when the tag already exists at a commit other than target. GitHub ignores target_commitish for an existing tag, so un-drafting would attach the release to that commit instead of the one that was built.

GitHub ignores target_commitish when the release tag already exists, so
un-drafting would attach the release to that commit instead of the one
that was built. publish-github-release now fails when the tag exists at
a commit other than the target; a missing tag is still created at the
target.

Rewritten with github-script so a missing tag is a plain 404 rather than
parsed CLI output, and pinning and un-drafting happen in one update.
@IgorDobryn
IgorDobryn merged commit 3dd0a83 into master Nov 11, 2026
5 checks passed
@IgorDobryn
IgorDobryn deleted the sdk-release-actions branch November 11, 2026 08: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.

4 participants