Skip to content

Conversation

@monadoid
Copy link
Contributor

@monadoid monadoid commented Dec 19, 2025

why

Add Stainless CI for SDK codegen Keep all client SDKs in sync with packages/server/openapi.v3.yaml automatically, with safe previews before merge.

what changed

Adds the Stainless-recommended GitHub Actions workflow: run preview@v1 on PR updates and merge@v1 when the PR is merged, using OIDC via the Stainless GitHub App.

test plan


Summary by cubic

Sets up Stainless CI in GitHub Actions to auto-sync SDKs from packages/server/openapi.v3.yaml. Runs preview builds on PRs and a merge build when PRs are merged.

  • New Features

    • Added .github/workflows/stainless.yml using Stainless preview@v1 on PR updates and merge@v1 on PR merge.
    • Uses API key auth via secrets.STAINLESS_API_KEY with least-privilege permissions and run cancelation.
    • Reads STAINLESS_ORG, STAINLESS_PROJECT, and OAS_PATH from Actions Variables/env.
    • Triggers on pull_request events (opened, synchronize, reopened, closed).
  • Migration

    • Add Actions Variables: STAINLESS_ORG and STAINLESS_PROJECT.
    • Set secrets.STAINLESS_API_KEY.
    • Ensure the spec lives at packages/server/openapi.v3.yaml.

Written for commit 9e18a31. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: 9e18a31

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps

This comment was marked as outdated.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Architecture diagram
sequenceDiagram
    participant Dev as Developer
    participant GHA as GitHub Actions
    participant Stainless as Stainless API

    Note over Dev,Stainless: NEW: Stainless CI Workflow

    alt PR Opened / Updated (Preview Flow)
        Dev->>GHA: Push changes to openapi.v3.yaml
        GHA->>GHA: NEW: Validate Config (ORG, PROJECT vars)
        
        alt Config Missing / Spec Missing
            GHA-->>Dev: Fail Job (Exit 1)
        else Config Valid
            GHA->>Stainless: NEW: Authenticate (OIDC)
            GHA->>Stainless: NEW: Upload Spec (preview@v1)
            Note right of Stainless: Generates SDK previews<br/>without publishing
            Stainless-->>GHA: Return Preview Result
            GHA-->>Dev: Update PR Status
        end

    else PR Merged (Publish Flow)
        Dev->>GHA: Merge Pull Request
        GHA->>GHA: NEW: Validate Config
        
        GHA->>Stainless: NEW: Authenticate (OIDC)
        GHA->>Stainless: NEW: Upload Spec (merge@v1)
        Note right of Stainless: Updates internal state<br/>Triggers SDK generation
        Stainless-->>GHA: Success
    end
Loading

@monadoid monadoid merged commit 8ee996e into main Dec 22, 2025
19 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.

5 participants