chore: import Speakeasy AI Control Plane CLI #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| issues: read | |
| id-token: write | |
| outputs: | |
| published: ${{ steps.changesets.outputs.published }} | |
| publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0 | |
| with: | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate a token | |
| id: generate-token | |
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | |
| with: | |
| app-id: ${{ vars.GRAM_BOT_APP_ID }} | |
| private-key: ${{ secrets.GRAM_BOT_PRIVATE_KEY }} | |
| - name: Configure git for GitHub App | |
| run: | | |
| git config user.name "speakeasy-bot[bot]" | |
| git config user.email "speakeasy-bot[bot]@users.noreply.github.com" | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | |
| with: | |
| title: "chore: version packages" | |
| publish: pnpm changeset publish | |
| setupGitUser: false | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Prune PNPM store | |
| run: pnpm store prune | |
| release-cli: | |
| needs: [release] | |
| if: needs.release.outputs.published == 'true' && contains(fromJSON(needs.release.outputs.publishedPackages).*.name, 'cli') | |
| name: Release Speakeasy CLI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go/cli/go.mod | |
| cache: false | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1 | |
| - name: Generate GitHub App Token for Speakeasy Bot | |
| id: bot-token | |
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | |
| with: | |
| app-id: ${{ secrets.GRAM_BOT_APP_ID }} | |
| private-key: ${{ secrets.GRAM_BOT_PRIVATE_KEY }} | |
| owner: speakeasy-api | |
| repositories: gf,homebrew-tap | |
| - name: Create release tag | |
| run: | | |
| version=$(jq -r .version go/cli/package.json) | |
| tag="cli@$version" | |
| git tag -f "$tag" | |
| echo "Created local tag $tag" | |
| - name: GoReleaser | |
| uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7.2.1 | |
| with: | |
| distribution: goreleaser-pro | |
| version: "~> v2.14" | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }} | |
| GORELEASER_KEY: ${{ secrets.GORELEASER_PRO_LICENSE_KEY }} |