From a6aecea722b67537f0f60d3b68d122b05786aa9e Mon Sep 17 00:00:00 2001 From: Blaine Kasten Date: Wed, 17 Dec 2025 10:31:07 -0600 Subject: [PATCH] internal: Fix commit message carry through to SDK changelogs --- .github/workflows/preview-builds.yml | 30 --------- .github/workflows/pull-request.yml | 80 +++++++++++++++++++++++ .github/workflows/upload-to-stainless.yml | 21 ------ 3 files changed, 80 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/preview-builds.yml create mode 100644 .github/workflows/pull-request.yml delete mode 100644 .github/workflows/upload-to-stainless.yml diff --git a/.github/workflows/preview-builds.yml b/.github/workflows/preview-builds.yml deleted file mode 100644 index 2ca565a..0000000 --- a/.github/workflows/preview-builds.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Preview Builds - -on: - pull_request: - types: - - opened - - synchronize - - reopened - - closed - -jobs: - preview: - if: github.event.action != 'closed' - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Run preview builds - uses: stainless-api/upload-openapi-spec-action/preview@v1 - with: - stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} - org: togetherai - project: togetherai - oas_path: openapi.yaml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..8a882f1 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,80 @@ +name: Build SDKs for pull request + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - closed + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +env: + # Stainless organization name. + STAINLESS_ORG: togetherai + + # Stainless project name. + STAINLESS_PROJECT: togetherai + + # Path to your OpenAPI spec. + OAS_PATH: openapi.yaml + + # Path to your Stainless config. Optional; only provide this if you prefer + # to maintain the ground truth Stainless config in your own repo. + # CONFIG_PATH: YOUR_CONFIG_PATH + + # When to fail the job based on build conclusion. + # Options: "never" | "note" | "warning" | "error" | "fatal". + FAIL_ON: error + +jobs: + preview: + if: github.event.action != 'closed' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Run preview builds + uses: stainless-api/upload-openapi-spec-action/preview@v1 + with: + stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} + org: ${{ env.STAINLESS_ORG }} + project: ${{ env.STAINLESS_PROJECT }} + oas_path: ${{ env.OAS_PATH }} + fail_on: ${{ env.FAIL_ON }} + + merge: + if: github.event.action == 'closed' && github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + # Note that this only merges in changes that happened on the last build on + # preview/${{ github.head_ref }}. It's possible that there are OAS/config + # changes that haven't been built, if the preview-sdk job didn't finish + # before this step starts. In theory we want to wait for all builds + # against preview/${{ github.head_ref }} to complete, but assuming that + # the preview-sdk job happens before the PR merge, it should be fine. + - name: Run merge build + uses: stainless-api/upload-openapi-spec-action/merge@v1 + with: + stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} + org: ${{ env.STAINLESS_ORG }} + project: ${{ env.STAINLESS_PROJECT }} + oas_path: ${{ env.OAS_PATH }} + fail_on: ${{ env.FAIL_ON }} \ No newline at end of file diff --git a/.github/workflows/upload-to-stainless.yml b/.github/workflows/upload-to-stainless.yml deleted file mode 100644 index 613c9d6..0000000 --- a/.github/workflows/upload-to-stainless.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Upload OpenAPI Spec to Stainless -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - stainless: - runs-on: ubuntu-latest - name: Stainless — Upload OpenAPI specification - steps: - - uses: actions/checkout@v4 - - # Upload OpenAPI spec to Stainless - - uses: stainless-api/upload-openapi-spec-action@main - with: - stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} - input_path: 'openapi.yaml' - output_path: 'openapi.documented.yaml' - project_name: 'togetherai'