Skip to content

Commit e89b37b

Browse files
chore: configure new SDK language
1 parent 080404b commit e89b37b

68 files changed

Lines changed: 13083 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup Go
2+
description: 'Sets up Go environment with private modules'
3+
inputs:
4+
stainless-api-key:
5+
required: false
6+
description: the value of the STAINLESS_API_KEY secret
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: stainless-api/retrieve-github-access-token@1f03f929b746c5b03dcdafa2bebbb18ca5672e1a # v1.0.0
11+
if: github.repository == 'stainless-sdks/context.dev-cli'
12+
id: get_token
13+
with:
14+
repo: stainless-sdks/context.dev-go
15+
stainless-api-key: ${{ inputs.stainless-api-key }}
16+
17+
- name: Configure Git for access to the Go SDK's staging repo
18+
if: github.repository == 'stainless-sdks/context.dev-cli'
19+
shell: bash
20+
run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.github_access_token }}@github.com/stainless-sdks/context.dev-go".insteadOf "https://github.com/stainless-sdks/context.dev-go"
21+
22+
- name: Setup go
23+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
24+
with:
25+
go-version-file: ./go.mod
26+
27+
- name: Bootstrap
28+
shell: bash
29+
run: ./scripts/bootstrap

‎.github/workflows/ci.yml‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
12+
pull_request:
13+
branches-ignore:
14+
- 'stl-preview-head/**'
15+
- 'stl-preview-base/**'
16+
17+
env:
18+
GOPRIVATE: github.com/context-dot-dev/context-go-sdk,github.com/stainless-sdks/context.dev-go
19+
20+
jobs:
21+
lint:
22+
timeout-minutes: 10
23+
name: lint
24+
runs-on: ${{ github.repository == 'stainless-sdks/context.dev-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
25+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
26+
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
30+
- uses: ./.github/actions/setup-go
31+
with:
32+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
33+
34+
- name: Link staging branch
35+
if: github.repository == 'stainless-sdks/context.dev-cli'
36+
run: |
37+
./scripts/link 'github.com/stainless-sdks/context.dev-go@${{ github.ref_name }}' || true
38+
39+
- name: Bootstrap
40+
run: ./scripts/bootstrap
41+
42+
- name: Run lints
43+
run: ./scripts/lint
44+
45+
build:
46+
timeout-minutes: 10
47+
name: build
48+
permissions:
49+
contents: read
50+
id-token: write
51+
runs-on: ${{ github.repository == 'stainless-sdks/context.dev-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
52+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
53+
steps:
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
56+
- uses: ./.github/actions/setup-go
57+
with:
58+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
59+
60+
- name: Link staging branch
61+
if: github.repository == 'stainless-sdks/context.dev-cli'
62+
run: |
63+
./scripts/link 'github.com/stainless-sdks/context.dev-go@${{ github.ref_name }}' || true
64+
65+
- name: Bootstrap
66+
run: ./scripts/bootstrap
67+
68+
- name: Run goreleaser
69+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
70+
with:
71+
version: latest
72+
args: release --snapshot --clean --skip=publish
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
76+
- name: Get GitHub OIDC Token
77+
if: |-
78+
github.repository == 'stainless-sdks/context.dev-cli' &&
79+
!startsWith(github.ref, 'refs/heads/stl/')
80+
id: github-oidc
81+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
82+
with:
83+
script: core.setOutput('github_token', await core.getIDToken());
84+
85+
- name: Upload tarball
86+
if: |-
87+
github.repository == 'stainless-sdks/context.dev-cli' &&
88+
!startsWith(github.ref, 'refs/heads/stl/')
89+
env:
90+
URL: https://pkg.stainless.com/s
91+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
92+
SHA: ${{ github.sha }}
93+
run: ./scripts/utils/upload-artifact.sh
94+
95+
test:
96+
timeout-minutes: 10
97+
name: test
98+
runs-on: ${{ github.repository == 'stainless-sdks/context.dev-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
99+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
100+
steps:
101+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
102+
103+
- uses: ./.github/actions/setup-go
104+
with:
105+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
106+
107+
- name: Link staging branch
108+
if: github.repository == 'stainless-sdks/context.dev-cli'
109+
run: |
110+
./scripts/link 'github.com/stainless-sdks/context.dev-go@${{ github.ref_name }}' || true
111+
112+
- name: Bootstrap
113+
run: ./scripts/bootstrap
114+
115+
- name: Run tests
116+
run: ./scripts/test
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Publish Release
3+
permissions:
4+
contents: write
5+
6+
concurrency:
7+
group: publish
8+
9+
on:
10+
push:
11+
tags:
12+
- "v*"
13+
workflow_dispatch: {}
14+
jobs:
15+
goreleaser:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
fetch-depth: 0
22+
- name: Set up Go
23+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
24+
with:
25+
go-version-file: "go.mod"
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
28+
with:
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'stainless-sdks/context.dev-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.prism.log
2+
.stdy.log
3+
dist/
4+
/context-dev
5+
*.exe

‎.goreleaser.yml‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
project_name: context-dev
2+
version: 2
3+
4+
before:
5+
hooks:
6+
- mkdir -p completions
7+
- sh -c "go run ./cmd/context-dev/main.go @completion bash > completions/context-dev.bash"
8+
- sh -c "go run ./cmd/context-dev/main.go @completion zsh > completions/context-dev.zsh"
9+
- sh -c "go run ./cmd/context-dev/main.go @completion fish > completions/context-dev.fish"
10+
- sh -c "go run ./cmd/context-dev/main.go @manpages -o man"
11+
12+
builds:
13+
- id: macos
14+
goos: [darwin]
15+
goarch: [amd64, arm64]
16+
binary: '{{ .ProjectName }}'
17+
main: ./cmd/context-dev/main.go
18+
mod_timestamp: '{{ .CommitTimestamp }}'
19+
ldflags:
20+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
21+
22+
- id: linux
23+
goos: [linux]
24+
goarch: ['386', arm, amd64, arm64]
25+
env:
26+
- CGO_ENABLED=0
27+
binary: '{{ .ProjectName }}'
28+
main: ./cmd/context-dev/main.go
29+
mod_timestamp: '{{ .CommitTimestamp }}'
30+
ldflags:
31+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
32+
33+
- id: windows
34+
goos: [windows]
35+
goarch: ['386', amd64, arm64]
36+
binary: '{{ .ProjectName }}'
37+
main: ./cmd/context-dev/main.go
38+
mod_timestamp: '{{ .CommitTimestamp }}'
39+
ldflags:
40+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
41+
42+
archives:
43+
- id: linux-archive
44+
ids: [linux]
45+
name_template: '{{ .ProjectName }}_{{ .Version }}_linux_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
46+
formats: [tar.gz]
47+
files:
48+
- completions/*
49+
- man/*/*
50+
- id: macos-archive
51+
ids: [macos]
52+
name_template: '{{ .ProjectName }}_{{ .Version }}_macos_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
53+
formats: [zip]
54+
files:
55+
- completions/*
56+
- man/*/*
57+
- id: windows-archive
58+
ids: [windows]
59+
name_template: '{{ .ProjectName }}_{{ .Version }}_windows_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
60+
formats: [zip]
61+
files:
62+
- completions/*
63+
- man/*/*
64+
65+
snapshot:
66+
version_template: '{{ .Tag }}-next'
67+
68+
nfpms:
69+
- license: Apache-2.0
70+
maintainer: hello@context.dev
71+
bindir: /usr
72+
formats:
73+
- apk
74+
- deb
75+
- rpm
76+
- termux.deb
77+
- archlinux
78+
contents:
79+
- src: man/man1/*.1.gz
80+
dst: /usr/share/man/man1/

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

‎.stats.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
configured_endpoints: 25
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-0253523aec437a0e9c67c3386fa25ed52ebbcc0073c907f0aa3586d8010d2e9d.yml
3+
openapi_spec_hash: 5cf86ed865b01dfe3a159a45315ebb49
4+
config_hash: 2b6e4424b446fe1bf93359ba758c83ed

0 commit comments

Comments
 (0)