Skip to content

Commit af7fad0

Browse files
chore: configure releases
1 parent 640c152 commit af7fad0

File tree

7 files changed

+216
-0
lines changed

7 files changed

+216
-0
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
10+
11+
jobs:
12+
lint:
13+
timeout-minutes: 10
14+
name: lint
15+
runs-on: ${{ github.repository == 'stainless-sdks/stainless-v0-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: ./go.mod
24+
25+
- name: Run lints
26+
run: ./scripts/lint
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: "go.mod"
25+
- name: Run GoReleaser
26+
uses: goreleaser/[email protected]
27+
with:
28+
version: latest
29+
args: release --clean
30+
env:
31+
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-api/stainless-api-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@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment

.goreleaser.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
project_name: stainless-api-cli
2+
version: 2
3+
4+
builds:
5+
- id: macos
6+
goos: [darwin]
7+
goarch: [amd64, arm64]
8+
binary: '{{ .ProjectName }}'
9+
mod_timestamp: "{{ .CommitTimestamp }}"
10+
ldflags:
11+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
12+
13+
- id: linux
14+
goos: [linux]
15+
goarch: ['386', arm, amd64, arm64]
16+
env:
17+
- CGO_ENABLED=0
18+
binary: '{{ .ProjectName }}'
19+
mod_timestamp: "{{ .CommitTimestamp }}"
20+
ldflags:
21+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
22+
23+
- id: windows
24+
goos: [windows]
25+
goarch: ['386', amd64, arm64]
26+
binary: '{{ .ProjectName }}'
27+
mod_timestamp: "{{ .CommitTimestamp }}"
28+
ldflags:
29+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
30+
31+
archives:
32+
- id: linux-archive
33+
ids: [linux]
34+
name_template: '{{ .ProjectName }}_{{ .Version }}_linux_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
35+
wrap_in_directory: true
36+
formats: [tar.gz]
37+
- id: macos-archive
38+
ids: [macos]
39+
name_template: '{{ .ProjectName }}_{{ .Version }}_macos_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
40+
wrap_in_directory: true
41+
formats: [zip]
42+
- id: windows-archive
43+
ids: [windows]
44+
name_template: '{{ .ProjectName }}_{{ .Version }}_windows_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
45+
wrap_in_directory: false
46+
formats: [zip]
47+
48+
snapshot:
49+
version_template: "{{ .Tag }}-next"
50+
51+
nfpms:
52+
- license: Apache-2.0
53+
maintainer:
54+
bindir: /usr
55+
formats:
56+
- deb
57+
- rpm

.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-alpha.0"
3+
}

bin/check-release-environment

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
lenErrors=${#errors[@]}
6+
7+
if [[ lenErrors -gt 0 ]]; then
8+
echo -e "Found the following errors in the release environment:\n"
9+
10+
for error in "${errors[@]}"; do
11+
echo -e "- $error\n"
12+
done
13+
14+
exit 1
15+
fi
16+
17+
echo "The environment is ready to push releases!"

release-please-config.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"packages": {
3+
".": {}
4+
},
5+
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
6+
"include-v-in-tag": true,
7+
"include-component-in-tag": false,
8+
"versioning": "prerelease",
9+
"prerelease": true,
10+
"bump-minor-pre-major": true,
11+
"bump-patch-for-minor-pre-major": false,
12+
"pull-request-header": "Automated Release PR",
13+
"pull-request-title-pattern": "release: ${version}",
14+
"changelog-sections": [
15+
{
16+
"type": "feat",
17+
"section": "Features"
18+
},
19+
{
20+
"type": "fix",
21+
"section": "Bug Fixes"
22+
},
23+
{
24+
"type": "perf",
25+
"section": "Performance Improvements"
26+
},
27+
{
28+
"type": "revert",
29+
"section": "Reverts"
30+
},
31+
{
32+
"type": "chore",
33+
"section": "Chores"
34+
},
35+
{
36+
"type": "docs",
37+
"section": "Documentation"
38+
},
39+
{
40+
"type": "style",
41+
"section": "Styles"
42+
},
43+
{
44+
"type": "refactor",
45+
"section": "Refactors"
46+
},
47+
{
48+
"type": "test",
49+
"section": "Tests",
50+
"hidden": true
51+
},
52+
{
53+
"type": "build",
54+
"section": "Build System"
55+
},
56+
{
57+
"type": "ci",
58+
"section": "Continuous Integration",
59+
"hidden": true
60+
}
61+
],
62+
"release-type": "simple"
63+
}

0 commit comments

Comments
 (0)