-
Notifications
You must be signed in to change notification settings - Fork 51
feat: tag-triggered SDK generation and release docs #738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea9f54e
Update Speakeasy config: rename requestBodyFieldName to body, use pos…
claude 44599cf
fix(examples): use body= in Python create_destination example for SDK…
leggetter 91c2adc
feat: tag-triggered SDK generation and release docs
leggetter 82d6a24
docs(release): merge SDK PRs before creating release, tag stays on or…
leggetter 86c643b
docs(sdks): state that workflows run on tag push with manual trigger …
leggetter 1cec177
docs(release): release-first flow, tag trigger note
leggetter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Generate all three SDKs (Go, Python, TypeScript) when a version tag is pushed. | ||
| # Runs sequentially to avoid conflicts on the shared .speakeasy/workflow.lock. | ||
| # Uses the reusable sdk-generate-one.yml so logic lives in one place. | ||
| # See contributing/release.md and contributing/sdks.md for the release process and lock file details. | ||
| # | ||
| # Outpost version from the tag is available as github.ref_name (e.g. v0.13.2) in the workflow context. | ||
| # workflow_dispatch allows testing without pushing a tag (run from Actions UI; uses selected branch ref). | ||
| name: SDK generate on release tag | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: {} # Run from Actions UI to test without pushing a tag (uses selected branch ref) | ||
|
|
||
| jobs: | ||
| generate-go: | ||
| uses: ./.github/workflows/sdk-generate-one.yml | ||
| with: | ||
| target: outpost-go | ||
| force: true | ||
| # SDK version override only when Outpost is released as v1.0.0 | ||
| set_version: ${{ github.ref_name == 'v1.0.0' && '1.0.0' || '' }} | ||
| secrets: | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} | ||
|
|
||
| generate-python: | ||
| needs: generate-go | ||
| uses: ./.github/workflows/sdk-generate-one.yml | ||
| with: | ||
| target: outpost-python | ||
| force: true | ||
| set_version: ${{ github.ref_name == 'v1.0.0' && '1.0.0' || '' }} | ||
| secrets: | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} | ||
| pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
|
|
||
| generate-ts: | ||
| needs: generate-python | ||
| uses: ./.github/workflows/sdk-generate-one.yml | ||
| with: | ||
| target: outpost-ts | ||
| force: true | ||
| set_version: ${{ github.ref_name == 'v1.0.0' && '1.0.0' || '' }} | ||
| secrets: | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} | ||
| npm_token: ${{ secrets.NPM_TOKEN }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Reusable workflow: generate one SDK target via Speakeasy. | ||
| # Used by the manual per-language workflows and by sdk-generate-on-release.yml. | ||
| # Callers pass target, optional set_version/force, and the required secrets. | ||
| name: SDK generate one target | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| target: | ||
| description: "Speakeasy target (outpost-go, outpost-python, or outpost-ts)" | ||
| required: true | ||
| type: string | ||
| set_version: | ||
| description: "Optional SDK version override (e.g. 1.0.0). Empty = Speakeasy detection." | ||
| required: false | ||
| type: string | ||
| force: | ||
| description: "Force generation even if no changes detected" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| secrets: | ||
| github_access_token: | ||
| required: true | ||
| speakeasy_api_key: | ||
| required: true | ||
| pypi_token: | ||
| required: false | ||
| npm_token: | ||
| required: false | ||
|
|
||
| jobs: | ||
| generate: | ||
| permissions: | ||
| checks: write | ||
| contents: write | ||
| pull-requests: write | ||
| statuses: write | ||
| id-token: write | ||
| uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 | ||
| with: | ||
| force: ${{ inputs.force }} | ||
| mode: pr | ||
| target: ${{ inputs.target }} | ||
| set_version: ${{ inputs.set_version || '' }} | ||
| secrets: | ||
| github_access_token: ${{ secrets.github_access_token }} | ||
| speakeasy_api_key: ${{ secrets.speakeasy_api_key }} | ||
| pypi_token: ${{ secrets.pypi_token }} | ||
| npm_token: ${{ secrets.npm_token }} |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Release process | ||
|
|
||
| This document is the **primary** guide for cutting an Outpost release. It covers both the Outpost binary/Docker release and SDK generation. For SDK-specific detail (manual generation, testing, publishing), see [SDKs](sdks.md). | ||
|
|
||
| ## Overview | ||
|
|
||
| **Step one: create the GitHub Release** (with the version tag). That is when Outpost is released. Following that, the tag triggers automatic SDK generation and creation of PRs for all three SDKs, **sequentially**. You then merge those PRs into main, and the SDKs are released. The tag stays on the commit you tagged; we do not move or rewrite the tag. | ||
|
|
||
| **Order of operations:** | ||
|
|
||
| 1. **You:** Create the **GitHub Release** with the version tag (e.g. `v0.13.2`). That is when Outpost is released. (Create the tag from the target branch when drafting the release if it doesn’t exist yet, or push the tag first and select it.) | ||
| 2. **Automated:** The tag triggers two workflows — [release.yml](../.github/workflows/release.yml) builds Outpost binaries and Docker images; [sdk-generate-on-release.yml](../.github/workflows/sdk-generate-on-release.yml) auto-generates the Go, Python, and TypeScript SDKs **sequentially** and opens a PR for each, targeting your default branch (e.g. `main`). | ||
| 3. **You:** Merge the three SDK PRs into main. | ||
| 4. **Automated:** The SDKs are released when those PRs are merged. | ||
|
|
||
| ## Process | ||
|
|
||
| ### 1. Create the GitHub Release (Outpost is released) | ||
|
|
||
| **You** create the release in GitHub; that is when Outpost is released. | ||
|
|
||
| 1. Go to **Releases** → **Draft a new release**. | ||
| 2. Attach the version tag (e.g. `v0.13.2`). If the tag doesn’t exist yet, create it from the target branch (e.g. `main`) when drafting the release, or create and push the tag first: | ||
| ```bash | ||
| git tag v0.13.2 | ||
| git push origin v0.13.2 | ||
| ``` | ||
| Use [Semantic Versioning](https://semver.org/): `vMAJOR.MINOR.PATCH`. | ||
| 3. Add release notes and publish. | ||
|
|
||
| The release is tied to that tag; GitHub associates the built assets (binaries, Docker) with the release once the tag exists and [release.yml](../.github/workflows/release.yml) has run. | ||
|
|
||
| ### 2. What runs automatically (SDK generation and PRs) | ||
|
|
||
| Both workflows are triggered on **tag push** (`push: tags: v*`). When you publish the GitHub Release, you attach (or create) the version tag; creating the tag in the UI causes GitHub to fire that tag push, so the workflows run right after the release is published. No change to Actions is needed: listening for the tag is equivalent for this process. | ||
|
|
||
| The tag triggers two workflows (they do not depend on each other): | ||
|
|
||
| | Workflow | What it does | | ||
| |----------|----------------| | ||
| | [release.yml](../.github/workflows/release.yml) | Builds Outpost binaries and Docker images (via GoReleaser) and uploads binary assets so they are available for the tag. Pushes Docker images to Docker Hub (e.g. `hookdeck/outpost:{{ tag }}-amd64`). | | ||
| | [sdk-generate-on-release.yml](../.github/workflows/sdk-generate-on-release.yml) | Auto-generates the Go, Python, and TypeScript SDKs **sequentially** and opens **three pull requests** (one per SDK), targeting your default branch (e.g. `main`). Sequential runs avoid conflicts on the shared `.speakeasy/workflow.lock` (see [SDKs – SDK generation and lock files](sdks.md#sdk-generation-and-lock-files)). | | ||
|
|
||
| ### 3. Merge the SDK PRs into main | ||
|
|
||
| Review and merge the **three pull requests** (Go, Python, TypeScript) opened by [sdk-generate-on-release.yml](../.github/workflows/sdk-generate-on-release.yml). Merge order does not matter. See [sdks.md](sdks.md) for testing and review. | ||
|
|
||
| - **SDK versions** are set by **Speakeasy detection** (breaking vs non-breaking), not by the Outpost tag. Exception: when you release **Outpost v1.0.0**, the workflow sets all three SDKs to **1.0.0**. | ||
|
|
||
| ### 4. SDKs are released | ||
|
|
||
| When the SDK PRs are merged into main, the SDKs are released (published). | ||
|
|
||
| ### 5. Outpost binaries (when and where) | ||
|
|
||
| - **When are they built?** — As soon as the tag is pushed. [release.yml](../.github/workflows/release.yml) runs and uses **GoReleaser** to build the binaries (e.g. `outpost`, `outpost-server`, `outpost-migrate-redis` for linux/amd64 and arm64), archive them (tar.gz), and build Docker images. | ||
| - **Where do they go?** — Binary archives are uploaded so they are available for that tag (e.g. as release assets once you create the release for the tag). Docker images are pushed to Docker Hub (e.g. `hookdeck/outpost:{{ tag }}-amd64`). | ||
|
|
||
| --- | ||
|
|
||
| ## When cutting an Outpost release (checklist) | ||
|
|
||
| 1. **Create the GitHub Release** — In GitHub, draft a new release, attach the version tag (e.g. `v0.13.2`; create the tag from the target branch if needed), add release notes, and publish. **Outpost is released** when you publish the release. | ||
| 2. **Workflows run automatically** — The tag triggers [release.yml](../.github/workflows/release.yml) (Outpost binaries + Docker) and [sdk-generate-on-release.yml](../.github/workflows/sdk-generate-on-release.yml), which generates the three SDKs **sequentially** and opens a PR for each. | ||
| 3. **Merge the SDK PRs** — Review and merge the three PRs (Go, Python, TypeScript) into main. See [SDKs](sdks.md) for testing and review guidance. | ||
| 4. **SDKs are released** when those PRs are merged to main. | ||
|
|
||
| For more detail on SDK generation, versioning, and lock files, see [contributing/sdks.md](sdks.md). | ||
|
|
||
| ## Testing the tag-triggered SDK workflow | ||
|
|
||
| To verify that [sdk-generate-on-release.yml](../.github/workflows/sdk-generate-on-release.yml) works without cutting a real release: | ||
|
|
||
| 1. **Option A — Push a temporary tag** | ||
| From the branch you want to test (e.g. `main` or a feature branch): | ||
| ```bash | ||
| git tag v0.0.0-sdk-gen-test # or e.g. v99.99.99-test | ||
| git push origin v0.0.0-sdk-gen-test | ||
| ``` | ||
| - In the repo **Actions** tab, open the run for **SDK generate on release tag** and confirm all three jobs (generate-go, generate-python, generate-ts) run in order and open PRs (or commit, depending on the Speakeasy action behaviour). | ||
| - To remove the tag after testing (optional): | ||
| ```bash | ||
| git tag -d v0.0.0-sdk-gen-test | ||
| git push origin --delete v0.0.0-sdk-gen-test | ||
| ``` | ||
| **Note:** Pushing a tag also triggers [release.yml](../.github/workflows/release.yml) (Outpost build/release). If you use a test tag, consider using a clearly non-release value (e.g. `v0.0.0-sdk-gen-test`) and skip creating a GitHub Release for it. | ||
|
|
||
| 2. **Option B — Manual run from Actions** | ||
| The workflow supports **Run workflow** from the Actions tab (workflow_dispatch). Go to **Actions → SDK generate on release tag**, click **Run workflow**, choose the branch (e.g. `main`), and run. This uses the branch ref instead of a tag, so no tag or release is created; useful for a quick smoke test. Note: `set_version` is only applied when the ref is tag `v1.0.0`, so on manual runs Speakeasy detection applies. |
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.