Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-stlc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ runs:
with:
version: "10.30.1"

- name: Install Rye
# The Python SDK's scripts/bootstrap runs `rye sync`.
shell: bash
env:
RYE_VERSION: "0.44.0"
RYE_SHA256: "e55e8b844c44820b540c3df46c8d4a3cee43a42ce5302e92bcd99b21d194a9bc"
run: |
rye_archive="$RUNNER_TEMP/rye-x86_64-linux.gz"
curl --fail --silent --show-error --location \
"https://github.com/astral-sh/rye/releases/download/${RYE_VERSION}/rye-x86_64-linux.gz" \
--output "$rye_archive"
echo "$RYE_SHA256 $rye_archive" | sha256sum --check
mkdir -p "$HOME/.rye/shims"
gzip --decompress --stdout "$rye_archive" > "$HOME/.rye/shims/rye"
chmod +x "$HOME/.rye/shims/rye"
echo "$HOME/.rye/shims" >> "$GITHUB_PATH"

- name: Install stlc and target generators
shell: bash
env:
Expand All @@ -39,5 +56,6 @@ runs:
npm install -g \
"git+https://x-access-token:${STLC_READ_TOKEN}@github.com/stainless/stlc.git#cfc85d2651330f7ba6a94dbe8e3c92ab64124f38" \
"git+https://x-access-token:${STLC_READ_TOKEN}@github.com/stainless/stlc-typescript.git#cd63c03a3381e7fbf05e1de78fb3e38a1fd1aaee" \
"git+https://x-access-token:${STLC_READ_TOKEN}@github.com/stainless/stlc-python.git#d67054a81ed5b5b863a2bbc321a23e9b66a8832d" \
"git+https://x-access-token:${STLC_READ_TOKEN}@github.com/stainless/stlc-go.git#9473a876905d28ab87c5a7bce69199a9389a2094"
stlc version
10 changes: 5 additions & 5 deletions .github/workflows/stlc-generate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generates the TypeScript and Go SDKs with the self-hosted stlc CLI,
# Generates the Python, TypeScript, and Go SDKs with the self-hosted stlc CLI,
# replacing the hosted-Stainless pipeline that stainless-sdks.yml used to drive.
#
# On pull_request: builds every target, pushes a stlc/preview/pr-N branch to each
Expand Down Expand Up @@ -60,8 +60,8 @@ env:
# An integration-test dispatch pushes this branch instead of the preview
# branch or main.
INTEGRATION_BRANCH: stlc/integration-test/run-${{ github.run_id }}
SDK_REPOS: hypeman-go-staging hypeman-ts-staging
SDK_TARGETS: go,typescript
SDK_REPOS: hypeman-go-staging hypeman-python-staging hypeman-ts-staging
SDK_TARGETS: go,python,typescript

jobs:
guard:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
app-id: ${{ secrets.ADMIN_APP_ID }}
private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: hypeman-go,hypeman-ts,hypeman-go-staging,hypeman-ts-staging
repositories: hypeman-go,hypeman-python,hypeman-ts,hypeman-go-staging,hypeman-python-staging,hypeman-ts-staging
permission-contents: write
permission-workflows: write
permission-pull-requests: write
Expand Down Expand Up @@ -420,7 +420,7 @@ jobs:
app-id: ${{ secrets.ADMIN_APP_ID }}
private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: hypeman-go-staging,hypeman-ts-staging
repositories: hypeman-go-staging,hypeman-python-staging,hypeman-ts-staging
permission-contents: write

- name: Delete the preview branches
Expand Down
10 changes: 5 additions & 5 deletions docs/runbooks/sdk-generation-stlc.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SDK generation with stlc

Hypeman's Go and TypeScript SDKs are generated by
Hypeman's Go, Python, and TypeScript SDKs are generated by
`.github/workflows/stlc-generate.yml` from `openapi.yaml` and `stainless.yaml`.

## Flow

1. A config-repo PR generates `stlc/preview/pr-<number>` branches in the two
1. A config-repo PR generates `stlc/preview/pr-<number>` branches in the three
internal SDK staging repositories and posts one build-manifest comment.
2. Merging the config PR validates the integrated SDKs and pushes staging
`main` only after bootstrap, lint, tests, and clean-worktree checks pass.
Expand Down Expand Up @@ -36,8 +36,8 @@ gh workflow run stlc-generate.yml --ref <branch> -f integration_test=true
```

The run creates a unique `stlc/integration-test/run-<run-id>` branch and draft
PR in both staging repos. Never merge these PRs; close them and delete their
branches after review.
PR in all three staging repos. Never merge these PRs; close them and delete
their branches after review.

## Custom code and recovery

Expand Down Expand Up @@ -71,4 +71,4 @@ rerun full SDK validation.

Remove hosted-only secrets and uninstall the Stainless GitHub App only after a
complete preview → staging → promotion → release-please → publish → back-sync
round trip succeeds for both SDKs.
round trip succeeds for all three SDKs.
10 changes: 10 additions & 0 deletions stainless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ targets:
prerelease: false
options:
enable_v2: true
python:
package_name: hypeman
production_repo: kernel/hypeman-python
staging_repo: kernel/hypeman-python-staging
publish:
pypi: true
release:
branch: main
prerelease: false
project_name: hypeman
typescript:
edition: typescript.2025-10-10
package_name: "@onkernel/hypeman"
Expand Down
Loading