|
25 | 25 | - Public members need XML doc comments (enforced via `GenerateDocumentationFile`). |
26 | 26 | - Run `dotnet format` before submitting a PR; CI verifies formatting. |
27 | 27 |
|
| 28 | +## Commit messages / PR titles |
| 29 | + |
| 30 | +This repo follows [Conventional Commits](https://www.conventionalcommits.org/) |
| 31 | +(`feat: ...`, `fix: ...`, `chore: ...`, etc., with a `BREAKING CHANGE:` footer |
| 32 | +when needed). This isn't just a style preference — `release-please` (see |
| 33 | +below) parses these to decide the next version number and to write the |
| 34 | +changelog automatically, so it needs to be the PR title if you squash-merge, |
| 35 | +or every commit message if you merge/rebase. |
| 36 | + |
28 | 37 | ## Pull request checklist |
29 | 38 |
|
30 | 39 | - [ ] Tests added/updated and passing (`dotnet test`) |
|
34 | 43 |
|
35 | 44 | ## Versioning and releasing |
36 | 45 |
|
37 | | -Versioning is computed by Nerdbank.GitVersioning from `version.json` and git |
38 | | -history — every commit gets a meaningful prerelease version |
39 | | -(`0.1.18-alpha.gb301a5cb61`-style) automatically; there's no manual version |
40 | | -bump. |
| 46 | +The version number and the release tag are both decided automatically by |
| 47 | +[release-please](.github/workflows/release-please.yml), not by hand: |
| 48 | + |
| 49 | +1. Every PR merged to `main` is analyzed by `release-please` for Conventional |
| 50 | + Commits since the last release. It maintains a single standing **Release |
| 51 | + PR** that accumulates these, with the computed next version |
| 52 | + (`fix:` → patch, `feat:` → minor, `BREAKING CHANGE:` → major) and an |
| 53 | + auto-written `CHANGELOG.md` section. |
| 54 | +2. Merging that Release PR creates and pushes a `vX.Y.Z` tag. |
| 55 | +3. That tag push is what triggers [release.yml](.github/workflows/release.yml), |
| 56 | + which builds, tests, and packs, then **requires manual approval** before |
| 57 | + publishing: the publish job runs under a `nuget-release` GitHub Environment |
| 58 | + (already configured with required reviewers). |
| 59 | + |
| 60 | +Don't create or push a `vX.Y.Z` tag by hand — that races with |
| 61 | +`release-please`'s own bookkeeping in `.release-please-manifest.json` and can |
| 62 | +leave it confused about what's already shipped. |
| 63 | + |
| 64 | +`release-please` pushes its tag using a fine-grained PAT in the |
| 65 | +`RELEASE_PLEASE_TOKEN` repo secret, not the default `GITHUB_TOKEN` - GitHub |
| 66 | +blocks the default token's pushes from triggering other workflows (its |
| 67 | +built-in loop-prevention), which would otherwise silently break the chain |
| 68 | +right before it reaches `release.yml`. `skip-github-release: true` in |
| 69 | +`release-please-config.json` stops `release-please` from also creating a |
| 70 | +GitHub Release itself - `release.yml`'s own publish job already creates one |
| 71 | +after a successful NuGet push, and having both would create two Releases for |
| 72 | +the same tag. |
41 | 73 |
|
42 | | -Pushing a `vX.Y.Z` tag triggers [release.yml](.github/workflows/release.yml), |
43 | | -which builds, tests, and packs, then **requires manual approval** before |
44 | | -publishing: the publish job runs under a `nuget-release` GitHub Environment |
45 | | -(already configured with required reviewers). |
| 74 | +Nerdbank.GitVersioning still computes the actual assembly/package version |
| 75 | +from `version.json` and git history at build time, the same as before - |
| 76 | +`release-please` only decides *which* tag to create; once that tag exists and |
| 77 | +matches `version.json`'s `publicReleaseRefSpec`, NBGV treats it as the public |
| 78 | +release version directly. |
46 | 79 |
|
47 | 80 | Publishing itself uses [NuGet Trusted Publishing](https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing) |
48 | 81 | (OIDC) rather than a stored API key — the workflow exchanges a short-lived |
|
0 commit comments