|
1 | | - |
2 | 1 | # Releasing |
3 | 2 |
|
4 | | -Once your changes are in master, the latest release should be set as a draft at https://github.com/pact-foundation/pact-go/releases/. |
| 3 | +Releasing is fully automated with [release-please](https://github.com/googleapis/release-please). There is nothing to run locally, no version to bump, and no changelog to hand-edit. |
| 4 | + |
| 5 | +## How it works |
| 6 | + |
| 7 | +1. Every push to `master` runs the [`release-please`](https://github.com/pact-foundation/pact-go/actions/workflows/release-please.yml) workflow. It scans commits since the last release for [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `feat!:`/`fix!:` or a `BREAKING CHANGE:` footer, `perf:`, `deps:`, etc.) and keeps a **Release PR** up to date with: |
| 8 | + - The next version, computed via semver from the commit types seen (`feat` → minor, `fix`/`perf`/`deps` → patch, breaking change → major). |
| 9 | + - A generated `CHANGELOG.md` entry. |
| 10 | +2. To cut a release, **merge the release PR**. On merge, release-please: |
| 11 | + - Tags `master` with the new version (e.g. `v2.6.0`). |
| 12 | + - Publishes a GitHub Release. |
| 13 | +3. The tag push triggers [`release.yml`](.github/workflows/release.yml), which runs [GoReleaser](https://goreleaser.com/) to build the release binaries and attach them to that GitHub Release. |
| 14 | + |
| 15 | +That's the whole process. Keep merging PRs into `master` with conventional commit messages, and merge the standing release PR whenever you're ready to ship what's accumulated on it. |
5 | 16 |
|
6 | | -Once you've tested that it works as expected: |
| 17 | +## Notes |
7 | 18 |
|
8 | | -1. Bump version in `command/version.go`. |
9 | | -2. Run `make release` to generate release notes and release commit. |
10 | | -3. Push tags `git push --follow-tags` |
11 | | -4. The pipeline will automatically trigger a release |
12 | | - 1. Edit the release notes at https://github.com/pact-foundation/pact-go/releases/edit/v<VERSION> if needed. |
| 19 | +- No `command/version.go` bump is needed: `pact-go version` resolves itself at runtime, either from the GoReleaser `-ldflags` (release binaries) or from the Go module version (`go install .../pact-go/v2@vX.Y.Z`). |
| 20 | +- Release-please's config lives in [`release-please-config.json`](release-please-config.json); the version it currently believes is released is tracked in [`.release-please-manifest.json`](.release-please-manifest.json). |
| 21 | +- If a GoReleaser run fails after a tag is already published, re-run [`release.yml`](https://github.com/pact-foundation/pact-go/actions/workflows/release.yml) manually via `workflow_dispatch`, passing the existing tag - it won't create a new tag or PR. |
| 22 | +- Commits that aren't `feat`/`fix`/etc. (e.g. `chore:`, `docs:`, `test:`) don't trigger a version bump on their own, but will still be picked up once a `feat`/`fix` commit lands. |
0 commit comments