Skip to content
Draft
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
8 changes: 5 additions & 3 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
runs:
using: composite
steps:
- uses: stainless-api/retrieve-github-access-token@v1
- uses: stainless-api/retrieve-github-access-token@1f03f929b746c5b03dcdafa2bebbb18ca5672e1a # v1.0.0
if: github.repository == 'stainless-sdks/anthropic-cli'
id: get_token
with:
Expand All @@ -17,10 +17,12 @@ runs:
- name: Configure Git for access to the Go SDK's staging repo
if: github.repository == 'stainless-sdks/anthropic-cli'
shell: bash
run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.github_access_token }}@github.com/stainless-sdks/anthropic-go".insteadOf "https://github.com/stainless-sdks/anthropic-go"
run: git config --global url."https://x-access-token:${STEPS_GET_TOKEN_OUTPUTS_GITHUB_ACCESS_TOKEN}@github.com/stainless-sdks/anthropic-go".insteadOf "https://github.com/stainless-sdks/anthropic-go"
env:
STEPS_GET_TOKEN_OUTPUTS_GITHUB_ACCESS_TOKEN: ${{ steps.get_token.outputs.github_access_token }}

- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: ./go.mod

Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

permissions:
contents: read

env:
GOPRIVATE: github.com/anthropics/anthropic-sdk-go,github.com/stainless-sdks/anthropic-go

Expand All @@ -25,16 +28,20 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork)

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: ./.github/actions/setup-go
with:
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} # zizmor: ignore[secrets-outside-env] — CI jobs run on every push/PR and cannot use deployment environments

- name: Link staging branch
if: github.repository == 'stainless-sdks/anthropic-cli'
env:
REF_NAME: ${{ github.ref_name }}
run: |
./scripts/link 'github.com/stainless-sdks/anthropic-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'
./scripts/link "github.com/stainless-sdks/anthropic-go@${REF_NAME}" || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -51,22 +58,26 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: ./.github/actions/setup-go
with:
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} # zizmor: ignore[secrets-outside-env] — CI jobs run on every push/PR and cannot use deployment environments

- name: Link staging branch
if: github.repository == 'stainless-sdks/anthropic-cli'
env:
REF_NAME: ${{ github.ref_name }}
run: |
./scripts/link 'github.com/stainless-sdks/anthropic-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'
./scripts/link "github.com/stainless-sdks/anthropic-go@${REF_NAME}" || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6.1.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: latest
args: release --snapshot --clean --skip=publish
Expand All @@ -78,7 +89,7 @@ jobs:
github.repository == 'stainless-sdks/anthropic-cli' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -93,47 +104,47 @@ jobs:
run: ./scripts/utils/upload-artifact.sh

- name: Upload cdp-darwin-arm64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-darwin-arm64
path: dist/macos_darwin_arm64*/cdp
retention-days: 90
if-no-files-found: ignore

- name: Upload cdp-darwin-amd64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-darwin-amd64
path: dist/macos_darwin_amd64*/cdp
retention-days: 90
if-no-files-found: ignore

- name: Upload cdp-linux-amd64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-linux-amd64
path: dist/linux_linux_amd64*/cdp
retention-days: 90
if-no-files-found: ignore

- name: Upload cdp-linux-arm64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-linux-arm64
path: dist/linux_linux_arm64*/cdp
retention-days: 90
if-no-files-found: ignore

- name: Upload cdp-windows-amd64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-windows-amd64
path: dist/windows_windows_amd64*/cdp.exe
retention-days: 90
if-no-files-found: ignore

- name: Upload cdp-windows-arm64
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cdp-windows-arm64
path: dist/windows_windows_arm64*/cdp.exe
Expand All @@ -146,16 +157,20 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: ./.github/actions/setup-go
with:
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} # zizmor: ignore[secrets-outside-env] — CI jobs run on every push/PR and cannot use deployment environments

- name: Link staging branch
if: github.repository == 'stainless-sdks/anthropic-cli'
env:
REF_NAME: ${{ github.ref_name }}
run: |
./scripts/link 'github.com/stainless-sdks/anthropic-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'
./scripts/link "github.com/stainless-sdks/anthropic-go@${REF_NAME}" || go mod edit -dropreplace='github.com/stainless-sdks/anthropic-go'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/claude-code-review.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/claude.yml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would like to keep this workflow. The only reason it wasn't working was because the API key wasn't configured, but I've fixed that since.

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
cache: false

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
release_doctor:
name: release doctor
Expand All @@ -13,7 +16,9 @@ jobs:
if: github.repository == 'anthropics/anthropic-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Check release environment
run: |
Expand Down
Loading