@@ -102,15 +102,31 @@ When you open a PR with spec changes:
102102
103103If breaking changes are detected or no changeset exists, the check fails.
104104
105- ### Release Workflow
106-
107- When a PR with changesets is merged to ` main ` :
108-
109- 1 . ** Consume Changesets** : Reads all pending changesets
110- 2 . ** Bump Versions** : Applies semantic version bumps
111- 3 . ** Update Changelog** : Appends changes to ` CHANGELOG.md `
112- 4 . ** Snapshot Spec** : Copies current spec to ` .contractual/snapshots/ `
113- 5 . ** Commit & Push** : Commits changes back to main
105+ ### Release Workflow (Automated)
106+
107+ The release workflow uses the ** Changesets pattern** with two phases:
108+
109+ #### ** Phase 1: Version PR Creation**
110+ When changesets are merged to ` main ` :
111+
112+ 1 . ** Detect Changesets** : Checks if changesets exist in ` .contractual/changesets/ `
113+ 2 . ** Create Version PR** : Opens/updates a PR named "Version Contracts" that:
114+ - Runs ` contractual version ` to bump versions
115+ - Updates ` CHANGELOG.md ` with changes
116+ - Updates snapshots in ` .contractual/snapshots/ `
117+ - Removes consumed changesets
118+ 3 . ** PR Review** : Team reviews the version bumps before release
119+
120+ #### ** Phase 2: Release Creation**
121+ When the Version PR is merged to ` main ` :
122+
123+ 1 . ** Detect Version Bump** : Checks if ` versions.json ` changed
124+ 2 . ** Create Git Tags** : Tags like ` petstore@1.1.0 ` for each versioned contract
125+ 3 . ** Create GitHub Releases** : One release per contract with:
126+ - Changelog excerpt for that contract
127+ - Attached OpenAPI spec file from snapshots
128+ - Release notes with breaking change warnings
129+ 4 . ** Publish** : (Optional, Phase 3) Publish to package registries
114130
115131---
116132
0 commit comments