Repository navigation
Add SDK release actions - #78
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 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
|
Follow-up from mailtrap/mailtrap-php#90 review: |
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.

Motivation
Mailtrap SDKs (public
mailtraporg) 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 inCHANGELOG.mdand reports whether a draft GitHub Release exists for it, so a release workflow triggered on push can skip ordinary pushes.tag-prefixcovers repos with bareX.Y.Ztagscheck-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 registrypublish-github-release: un-drafts a release; optionaltargetpins it to the built commit firstrepo/github-tokendefault to the current repository andgithub.token, as inabort-if-tag-existsactions/github-scriptpinned to a commit SHA, since these run in jobs that can publishHow to test
resolve-pending-release@sdk-release-actionsin a repo whose top changelog version has a draft release →pending=true; published release →pending=falsepending=falsepublish-github-releasewithtargeton a throwaway draft → tag created at that commit