@@ -221,6 +221,135 @@ This pipeline is typically run as part of a GitHub Action:
221221
222222The generated overlay is then used by Speakeasy to create the Terraform provider.
223223
224+ ## Release Process
225+
226+ Our automated release process ensures consistent versioning and reliable publishing of the Terraform provider.
227+
228+ ### Overview
229+
230+ The release process consists of three main GitHub Actions workflows:
231+
232+ 1. **SDK Generation** (` sdk_generation.yaml`) - Daily automated provider generation
233+ 2. **Tag Release** (`tag_release.yaml`) - Creates release tags when provider code changes
234+ 3. **Release Terraform Provider** (`release.yaml`) - Publishes the provider to registries
235+
236+ # ## Automated Release Flow
237+
238+ ` ` ` mermaid
239+ flowchart TD
240+ A [Daily: SDK Generation Workflow] --> [Speakeasy Bot Opens PR]
241+ B --> Merge PR to main
242+ C --> {PR Contains /internal Changes?}
243+ C -->|Yes| [Tag Release Workflow Triggered]
244+ C -->|No| [No release]
245+ D --> [Extract Version from PR Title]
246+ E --> [Create Git Tag]
247+ F --> [Release Workflow Triggered]
248+ G --> [GoReleaser Publishes Provider]
249+ ` ` `
250+
251+ # ## Workflow Details
252+
253+ # ### 1. SDK Generation (`sdk_generation.yaml`)
254+ **Triggers:** Daily at midnight, manual dispatch
255+ **Purpose:** Generate updated provider from latest OpenAPI spec
256+
257+ **Process:**
258+ - Fetches latest OpenAPI spec from developers repo
259+ - Runs normalization and overlay scripts
260+ - Generates provider via Speakeasy
261+ - Speakeasy bot opens PR with changes
262+
263+ # ### 2. Tag Release (`tag_release.yaml`)
264+ **Triggers:** Push to main with `/internal/**` changes, manual dispatch
265+ **Purpose:** Create release tags with proper versioning
266+
267+ **Version Sources (in priority order):**
268+ 1. **Manual dispatch** with `set_version` input
269+ 2. **Speakeasy PR title** - Extracts version from pattern : ` "chore: 🐝 Update SDK - Generate X.X.X"`
270+ 3. **Workflow fails** if no version found (no auto-increment to prevent wrong versions)
271+
272+ **Process:**
273+ - Detects version from PR title or manual input
274+ - Creates annotated Git tag (e.g., `v0.2.7`)
275+ - Pushes tag to repository
276+
277+ # ### 3. Release Terraform Provider (`release.yaml`)
278+ **Triggers:** Git tag creation (`v*` pattern), manual dispatch
279+ **Purpose:** Publish provider to Terraform Registry
280+
281+ **Process:**
282+ - Triggered automatically when tag is created
283+ - Runs GoReleaser to build and publish provider
284+ - Creates GitHub release with assets
285+ - Publishes to Terraform Registry
286+
287+ # ## Manual Release Process
288+
289+ For manual releases or hotfixes :
290+
291+ 1. **Direct tag creation:**
292+ ` ` ` bash
293+ git tag v0.2.8
294+ git push origin v0.2.8
295+ ` ` `
296+
297+ 2. **Via workflow dispatch:**
298+ - Go to Actions → "Tag Release" workflow
299+ - Click "Run workflow"
300+ - Set `set_version` to desired version (e.g., `0.2.8`)
301+ - Run workflow
302+
303+ # ## Version Management
304+
305+ - **Current version scheme:** `v0.2.X` (semantic versioning)
306+ - **Speakeasy determines versions** based on API changes
307+ - **No auto-increment** to prevent accidental releases
308+ - **Version extraction** from PR titles ensures accuracy
309+
310+ # ## Troubleshooting
311+
312+ # ### Tag Mismatch Errors
313+ If you see errors like "git tag v0.2.6 was not made against commit...", fix with :
314+ ` ` ` bash
315+ git tag -d v0.2.6
316+ git push origin :refs/tags/v0.2.6
317+ git tag v0.2.6
318+ git push origin v0.2.6
319+ ` ` `
320+
321+ # ### Missing Version in PR
322+ If the Tag Release workflow fails due to missing version :
323+ - Check PR title follows format : ` "chore: 🐝 Update SDK - Generate X.X.X"`
324+ - Use manual dispatch with `set_version` as fallback
325+
326+ # ### Release Workflow Fails
327+ - Verify tag exists and points to correct commit
328+ - Check GitHub tokens and secrets are configured
329+ - Ensure GoReleaser configuration is valid
330+
331+ # ## Testing Release Process
332+
333+ To test the release process safely :
334+
335+ 1. **Create test branch:**
336+ ` ` ` bash
337+ git checkout -b test-release
338+ ` ` `
339+
340+ 2. **Modify tag workflow** to trigger on test branch
341+ 3. **Use dry-run mode** to validate without creating actual tags
342+ 4. **Test version extraction** with sample commit messages
343+
344+ # ## Prerequisites
345+
346+ Ensure these secrets are configured in GitHub :
347+ - ` GITHUB_TOKEN` (automatic)
348+ - ` terraform_gpg_private_key` (for signing)
349+ - ` terraform_gpg_passphrase` (for signing)
350+ - ` FH_OPS_SSH_KEY` (for accessing developers repo)
351+ - ` SPEAKEASY_API_KEY` (for SDK generation)
352+
224353# # Provider Local Testing
225354
226355After `speakeasy run` has successfully completed.
0 commit comments