Skip to content

Commit 270c13e

Browse files
authored
Merge pull request #1 from moderation-api/speakeasy/regenerate
feat!: regenerate SDK from the OpenAPI spec (Speakeasy)
2 parents fdedf03 + caee264 commit 270c13e

211 files changed

Lines changed: 58139 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.go linguist-generated=false

‎.github/workflows/release.yaml‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check release version
21+
run: |
22+
tag_version="${GITHUB_REF_NAME#v}"
23+
cli_version=$(sed -n 's/^var Version = "\(.*\)"$/\1/p' internal/cli/version.go)
24+
if [ -z "$cli_version" ] || [ "$tag_version" != "$cli_version" ]; then
25+
printf '::error::Release tag %s does not match generated CLI version %s. Set cli.version in .speakeasy/gen.yaml to %s and regenerate before tagging.\n' "$GITHUB_REF_NAME" "$cli_version" "$tag_version"
26+
exit 1
27+
fi
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
31+
with:
32+
go-version-file: "go.mod"
33+
cache: true
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
36+
with:
37+
distribution: goreleaser
38+
version: "~> v2"
39+
args: release --clean
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Upload artifacts
44+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
45+
if: always()
46+
with:
47+
name: release-artifacts
48+
path: |
49+
dist/
50+
!dist/*.txt
51+
retention-days: 30

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# .gitignore
2+
.DS_Store
3+
**/.speakeasy/temp/
4+
**/.speakeasy/logs/
5+
.speakeasy/reports
6+
.env
7+
.env.local
8+
dist/

‎.goreleaser.yaml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
version: 2
3+
4+
project_name: modapi
5+
6+
before:
7+
hooks:
8+
- go mod tidy
9+
10+
builds:
11+
- id: modapi
12+
main: ./cmd/modapi
13+
binary: modapi
14+
env:
15+
- CGO_ENABLED=0
16+
goos:
17+
- linux
18+
- windows
19+
- darwin
20+
goarch:
21+
- amd64
22+
- arm64
23+
ldflags:
24+
- -s -w
25+
- -X main.version={{.Version}}
26+
- -X main.buildTime={{.Date}}
27+
28+
archives:
29+
- id: modapi
30+
formats: [tar.gz]
31+
name_template: >-
32+
{{ .ProjectName }}_
33+
{{- title .Os }}_
34+
{{- if eq .Arch "amd64" }}x86_64
35+
{{- else if eq .Arch "386" }}i386
36+
{{- else }}{{ .Arch }}{{ end }}
37+
{{- if .Arm }}v{{ .Arm }}{{ end }}
38+
format_overrides:
39+
- goos: windows
40+
formats: [zip]
41+
files:
42+
- README.md
43+
- LICENSE*
44+
45+
release:
46+
github:
47+
owner: moderation-api
48+
name: cli
49+
draft: false
50+
prerelease: auto
51+
mode: append
52+
53+
checksum:
54+
name_template: "checksums.txt"

0 commit comments

Comments
 (0)