Skip to content

Commit be5ab2d

Browse files
authored
Merge pull request #30 from speakeasy-api/chore/refactor
chore: reactivate this repository as a home for cli / functions framework
2 parents fdf4fea + a4b8d01 commit be5ab2d

347 files changed

Lines changed: 40809 additions & 0 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.

.changeset/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changesets
2+
3+
Changesets drive npm package publishing and CLI release tagging.
4+
5+
Run `pnpm changeset` when a change should publish a new package version.

.changeset/config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": [
5+
"@changesets/cli/commit",
6+
{
7+
"skipCI": false
8+
}
9+
],
10+
"fixed": [["@gram-ai/functions", "@gram-ai/create-function"]],
11+
"linked": [],
12+
"access": "public",
13+
"baseBranch": "origin/main",
14+
"updateInternalDependencies": "patch",
15+
"privatePackages": {
16+
"version": true,
17+
"tag": true
18+
}
19+
}

.github/workflows/release.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: read
17+
issues: read
18+
id-token: write
19+
outputs:
20+
published: ${{ steps.changesets.outputs.published }}
21+
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
22+
steps:
23+
- name: Checkout Repo
24+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
25+
26+
- name: Setup PNPM
27+
uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0
28+
with:
29+
run_install: false
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
33+
with:
34+
node-version: 24
35+
cache: pnpm
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Generate a token
41+
id: generate-token
42+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
43+
with:
44+
app-id: ${{ vars.GRAM_BOT_APP_ID }}
45+
private-key: ${{ secrets.GRAM_BOT_PRIVATE_KEY }}
46+
47+
- name: Configure git for GitHub App
48+
run: |
49+
git config user.name "gram-bot[bot]"
50+
git config user.email "gram-bot[bot]@users.noreply.github.com"
51+
52+
- name: Create Release Pull Request or Publish to npm
53+
id: changesets
54+
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
55+
with:
56+
title: "chore: version packages"
57+
publish: pnpm changeset publish
58+
setupGitUser: false
59+
env:
60+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
61+
62+
- name: Prune PNPM store
63+
run: pnpm store prune
64+
65+
release-cli:
66+
needs: [release]
67+
if: needs.release.outputs.published == 'true' && contains(fromJSON(needs.release.outputs.publishedPackages).*.name, 'cli')
68+
name: Release Speakeasy CLI
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: write
72+
id-token: write
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
76+
with:
77+
fetch-depth: 0
78+
79+
- name: Setup Go
80+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
81+
with:
82+
go-version-file: go/cli/go.mod
83+
cache: false
84+
85+
- name: Install cosign
86+
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
87+
88+
- name: Generate GitHub App Token for Gram Bot
89+
id: bot-token
90+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
91+
with:
92+
app-id: ${{ secrets.GRAM_BOT_APP_ID }}
93+
private-key: ${{ secrets.GRAM_BOT_PRIVATE_KEY }}
94+
owner: speakeasy-api
95+
repositories: gf,homebrew-tap
96+
97+
- name: Create release tag
98+
run: |
99+
version=$(jq -r .version go/cli/package.json)
100+
tag="cli@$version"
101+
git tag -f "$tag"
102+
echo "Created local tag $tag"
103+
104+
- name: GoReleaser
105+
uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7.2.1
106+
with:
107+
distribution: goreleaser-pro
108+
version: "~> v2.14"
109+
args: release --clean
110+
env:
111+
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
112+
GORELEASER_KEY: ${{ secrets.GORELEASER_PRO_LICENSE_KEY }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
3+
# Go
4+
bin/
5+
coverage.out
6+
7+
# TypeScript
8+
node_modules/
9+
dist/
10+
*.tsbuildinfo
11+

.goreleaser.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/goreleaser/goreleaser/v2.12.5/www/docs/static/schema-pro.json
2+
3+
version: 2
4+
5+
project_name: gram
6+
7+
builds:
8+
- dir: ./go/cli
9+
env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- windows
14+
- darwin
15+
flags:
16+
- -trimpath
17+
ldflags:
18+
- "-s -w -X github.com/speakeasy-api/gf/go/cli/internal/app.GitSHA={{.Commit}} -X github.com/speakeasy-api/gf/go/cli/internal/app.Version={{.Version}}"
19+
20+
archives:
21+
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
22+
format: zip
23+
24+
checksum:
25+
name_template: "checksums.txt"
26+
27+
signs:
28+
- cmd: cosign
29+
signature: "${artifact}.sigstore.json"
30+
artifacts: checksum
31+
args:
32+
- sign-blob
33+
- "--bundle=${signature}"
34+
- "${artifact}"
35+
- --yes
36+
37+
snapshot:
38+
version_template: "{{ incpatch .Version }}-next"
39+
40+
changelog:
41+
disable: true
42+
43+
release:
44+
mode: keep-existing
45+
46+
monorepo:
47+
tag_prefix: "cli@"
48+
49+
brews:
50+
- name: gram
51+
repository:
52+
owner: speakeasy-api
53+
name: homebrew-tap
54+
homepage: https://app.getgram.ai
55+
description: The Speakeasy CLI for interacting with the Speakeasy AI Control Plane
56+
license: Apache-2.0
57+
test: |
58+
system "#{bin}/gram --version"
59+
60+
- name: gram@{{ .Major }}.{{ .Minor }}.{{ .Patch }}
61+
repository:
62+
owner: speakeasy-api
63+
name: homebrew-tap
64+
homepage: https://app.getgram.ai
65+
description: The Speakeasy CLI for interacting with the Speakeasy AI Control Plane
66+
license: Apache-2.0
67+
test: |
68+
system "#{bin}/gram --version"

0 commit comments

Comments
 (0)