Skip to content

Allow releasing specific commits, and publishing immediately - #868

Merged
stpierre merged 2 commits into
temporalio:mainfrom
stpierre:RE-586
Sep 10, 2026
Merged

Allow releasing specific commits, and publishing immediately#868
stpierre merged 2 commits into
temporalio:mainfrom
stpierre:RE-586

Conversation

@stpierre

@stpierre stpierre commented Sep 9, 2026

Copy link
Copy Markdown
Member

What changed?

Add api_ref and api_go_ref so a caller can name the commits to release, and auto_publish so it can skip the manual publish step. All three default to the existing behavior, so a manual dispatch is unaffected.

Why?

These changes will allow us to automate API releases as part of server releases.

create-release.yml could only release the head of a branch, and only as a draft. Neither works for an automated caller: a cloud release branch pins a specific api-go commit, and a draft release creates no tag, which is the thing the release invariant actually requires.

Breaking changes

None.

Server PR

N/A

@stpierre
stpierre requested review from a team September 9, 2026 17:51
`create-release.yml` could only release the head of a branch, and only as a
draft. Neither works for an automated caller: a cloud release branch pins a
specific api-go commit, and a draft release creates no tag, which is the
thing the release invariant actually requires.

Add `api_ref` and `api_go_ref` so a caller can name the commits to release,
and `auto_publish` so it can skip the manual publish step. All three default
to the existing behavior, so a manual dispatch is unaffected.

Publishing this repo's release is what fires `release: published`, which
`trigger-api-go-publish-release.yml` turns into api-go's `publish-release.yml`
-- the step that creates the api-go tag. The new job therefore has to run
after `release-api-go` and has to use the app token; the comment explains
why, since getting either wrong yields a green run and no tag.

Also add the `permissions: contents: read` block this workflow never had,
matching ci.yml and push-to-buf.yml. Read-only covers every job: the releases
are created and published with a GitHub App token rather than GITHUB_TOKEN,
and the reusable workflows called from here only read. Without it the SAST
scan fails on security.gha.missing-explicit-permissions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/create-release.yml Outdated
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
TAG: ${{ github.event.inputs.tag }}
run: gh release edit "$TAG" --draft=false -R "$GITHUB_REPOSITORY"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this always set the new release as "latest"? If so, maybe we need an extra input to decide if this is "latest" or not.

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.

As written, this does not set it as latest. How should we approach that? I can see four options; two are defensible:

  • Always set it as latest. I think this is what we've done historically, but that doesn't mean it's right (but it does mean that it at least isn't so wrong that it's caused issues so far).
  • Add an input to allow setting latest, default to true. Preserves historical behavior but gives us an escape hatch; downside is extra complexity that I'm not sure we'd ever actually use.

Two are less defensible:

  • Add an input to allow setting latest, default to false. Diverges from historical behavior, adds complexity, and I'm not sure we gain anything.
  • Never set it as latest (the current approach). Diverges from historical behavior for no good reason.

Happy to defer to your judgment on this -- RelEng just wants to cut releases however releases should be cut.

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.

I've updated this to always mark as latest, which is at least more correct than never marking it as latest. Happy to adjust that if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

- release-api-go
if: |
!cancelled() &&
(inputs.auto_publish == true || inputs.auto_publish == 'true') &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When would we need the == 'true' part? Isn't it always boolean since it's an input?

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.

Isn't it always boolean since it's an input?

If Github Actions was even just a moderately terrible system, yes. But instead, no. workflow_call events pass booleans as booleans, but workflow_dispatch events pass them as strings. Even though this WF currently only has a workflow_dispatch trigger, adding both is smart forward-compatibility, because someone adding a workflow_call trigger would not necessarily suspect that the exact same input variable might be a boolean in one case and a string in another, even though it's declared as a boolean in both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gotcha; ok that makes sense 👍

@stpierre
stpierre enabled auto-merge (squash) September 10, 2026 19:58
@stpierre
stpierre merged commit 2af5c1d into temporalio:main Sep 10, 2026
4 checks passed
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