Skip to content

Commit fdf8757

Browse files
committed
chore(api): regenerate SDK
- Regenerated with generator `0.19.6` (previously `0.19.4`). Build: nsjbgvUiQhkgth2MRAFhi
1 parent 9ac54a5 commit fdf8757

6 files changed

Lines changed: 98 additions & 1471 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121
outputs:
2222
release_created: ${{ steps.release.outputs.release_created }}
23-
# Consumed by the publish job's dispatch: without this mapping the dispatch ref would
24-
# be empty, and `gh workflow run --ref ""` silently falls back to the default branch
25-
# instead of the released tag.
23+
# Consumed by the publish job's checkout: without this mapping the checkout ref would be
24+
# empty and the publish would build the triggering branch head instead of the released
25+
# tag's exact commit.
2626
tag_name: ${{ steps.release.outputs.tag_name }}
2727
steps:
2828
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
@@ -57,28 +57,39 @@ jobs:
5757
git push origin scalar-next
5858
publish:
5959
needs: release-please
60+
# `!cancelled()` keeps publishing even when the back-sync to the integration branch
61+
# failed: a raced integration branch must not block the release from reaching its
62+
# registry.
6063
if: ${{ !cancelled() && needs.release-please.outputs.release_created == 'true' }}
6164
runs-on: ubuntu-latest
65+
# Job-level permissions replace the workflow's release-cutting grants with the publish
66+
# floor. OIDC trusted publishing verifies this run's claims, which name this workflow
67+
# file — register release-please.yml as the trusted publisher on the registry.
6268
permissions:
63-
actions: write
69+
contents: read
70+
id-token: write
71+
packages: write
72+
env:
73+
VERSIONING_POLICY: manual
6474
steps:
65-
- name: Publish via the release workflow at the released tag
66-
env:
67-
GH_TOKEN: ${{ github.token }}
68-
TAG: ${{ needs.release-please.outputs.tag_name }}
69-
# Dispatch, then watch the run to completion: the dispatch API does not return the run
70-
# it created, so the newest workflow_dispatch run on the tag is polled into view (the
71-
# tag is unique per release, so it can only be this dispatch or an identical manual
72-
# re-publish) and a failed or missing run fails this job loudly.
73-
run: |
74-
gh workflow run sdk-release.yml --repo "${GITHUB_REPOSITORY}" --ref "${TAG}"
75-
for _ in $(seq 1 12); do
76-
sleep 5
77-
run_id="$(gh run list --repo "${GITHUB_REPOSITORY}" --workflow sdk-release.yml --event workflow_dispatch --branch "${TAG}" --json databaseId --jq '.[0].databaseId // empty')"
78-
[ -n "${run_id}" ] && break
79-
done
80-
if [ -z "${run_id}" ]; then
81-
echo "::error::sdk-release.yml was dispatched for ${TAG} but no run appeared."
82-
exit 1
83-
fi
84-
gh run watch "${run_id}" --repo "${GITHUB_REPOSITORY}" --exit-status
75+
# Publishing runs inline — a top-level job of this same run — rather than dispatching
76+
# sdk-release.yml: workflow_dispatch resolves the target workflow on the repository's
77+
# default branch only, so a dispatch would 404 whenever the release line is any other
78+
# branch, while OIDC trusted publishing accepts this job because it stays top-level
79+
# (never a reusable-workflow call). The release-please job cut the tag earlier in this
80+
# run; checking it out publishes exactly the released commit, not the branch head that
81+
# triggered the workflow.
82+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
83+
with:
84+
ref: ${{ needs.release-please.outputs.tag_name }}
85+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
86+
with:
87+
node-version: "22.14.0"
88+
registry-url: "https://registry.npmjs.org"
89+
- run: npm install
90+
- run: npm run build
91+
# OIDC trusted publishing needs npm >= 11.5; pinned to the major (not `latest`) so a new
92+
# npm major raising its Node engine floor cannot break publishes against the pinned Node.
93+
- run: npm install -g npm@11
94+
- name: Publish to npm
95+
run: node scripts/publish-npm.mjs

.github/workflows/sdk-release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: TypeScript SDK Release
22

33
on:
4-
release:
5-
types: [published]
6-
# Dispatched by release-please.yml at the released tag (the trigger a default-GITHUB_TOKEN
7-
# release can still reach), and available for manual re-publishes. A dispatched run is
8-
# top-level, keeping the OIDC trusted-publisher claims on this file; never add a
9-
# workflow_call trigger here — registries reject publishes from called (reusable) workflows.
4+
# Manual re-publish only: the automated publish for each release runs as the `publish` job
5+
# inside release-please.yml, in the same run that cuts the tag (dispatching a workflow here
6+
# instead would resolve it on the repository's default branch only, which breaks releasing
7+
# from any other release line). Dispatch this workflow at an existing release tag to re-run
8+
# a failed or skipped publish. A dispatched run is top-level, so OIDC trusted-publisher
9+
# claims name this file; register it as an additional trusted publisher only when manual
10+
# re-publishes are used. Never add a workflow_call trigger here — registries reject
11+
# publishes from called (reusable) workflows.
1012
workflow_dispatch:
1113

1214
permissions:

VERSIONING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ different fixes:
5858
- No Actions settings changes are required: the generated workflows declare their own
5959
permissions and never create pull requests.
6060
- If this package publishes through OIDC trusted publishing (for example PyPI or npm),
61-
register the trusted publisher on the registry against the **`sdk-release.yml`**
62-
workflow filename — not `release-please.yml`. Merging a release PR dispatches
63-
`sdk-release.yml` at the released tag, so every publish path (automated, manual
64-
re-publish, human-created release) runs it as a top-level workflow whose OIDC claims
65-
name that file. If the publish job is configured with a deployment environment,
61+
register the trusted publisher on the registry against the **`release-please.yml`**
62+
workflow filename. Merging a release PR publishes from the `publish` job inside that
63+
same workflow run (checked out at the released tag), so the automated path's OIDC
64+
claims name that file — and, because nothing is dispatched, releasing works from any
65+
release branch, not only the repository default branch. `sdk-release.yml` exists for
66+
manual re-publishes at an existing tag; register it as an additional trusted publisher
67+
only if you use it. If the publish job is configured with a deployment environment,
6668
include that environment in the registration too.

0 commit comments

Comments
 (0)