|
2 | 2 |
|
3 | 3 | This project uses [release-please](https://github.com/googleapis/release-please) (via the |
4 | 4 | `googleapis/release-please-action` GitHub Action) to automate versioning and release |
5 | | -management. Every push to `main` triggers RP to evaluate conventional commit messages |
6 | | -since the last release and propose a release PR. |
| 5 | +management. Every push to `main` triggers release-please to evaluate Conventional Commit |
| 6 | +messages since the last release and propose a release PR. |
7 | 7 |
|
8 | | -## Version pinning (fixed at v4) |
| 8 | +## Version pinning |
9 | 9 |
|
10 | | -RP is pinned to **v4** of `googleapis/release-please-action` via an explicit commit SHA: |
| 10 | +The workflow pins `googleapis/release-please-action` to the v5.0.0 commit SHA: |
11 | 11 |
|
12 | | -``` |
13 | | -uses: googleapis/release-please-action@8b8fd2cc23b2e18957157a9d923d75aa0c6f6ad5 # v4 |
| 12 | +```yaml |
| 13 | +uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 |
14 | 14 | ``` |
15 | 15 |
|
16 | | -We deliberately do **not** use a floating tag (`v4`) or a version range (`>=4`). This |
17 | | -prevents Dependabot or GitHub's own action resolver from silently upgrading the action to |
18 | | -v5, which would trigger phantom major-version bumps (e.g. 3.x → 4.0.0) because v5 uses a |
19 | | -different release-please CLI that re-evaluates the entire commit history. |
| 16 | +The explicit SHA prevents an action-tag update from changing release behavior |
| 17 | +unexpectedly. The root-level `last-release-sha` in `release-please-config.json` anchors |
| 18 | +release-please after the v3.21.5 release commit so old breaking-change footers cannot |
| 19 | +recreate the retired phantom v4.0.0 release. |
20 | 20 |
|
21 | | -## Preventing phantom major-version bumps |
| 21 | +## Commit types and one-time recovery |
22 | 22 |
|
23 | | -The primary protection against phantom bumps (e.g. 3.x → 4.0.0) is **pinning the |
24 | | -action to a v4 commit SHA** (see above). RP v5 re-evaluates the entire commit history |
25 | | -and may propose a major bump based on old breaking-change commits. |
| 23 | +Release-please treats user-facing Conventional Commits such as `fix`, `feat`, and |
| 24 | +`deps` as releaseable. Routine `chore` commits are not releaseable. The scheduled module |
| 25 | +compatibility workflow therefore generates: |
26 | 26 |
|
27 | | -Beyond that, RP is **self-managing**: it tracks `last-release-sha` internally and |
28 | | -updates it automatically when a release is published. No manual SHA management is |
29 | | -needed under normal operation. |
| 27 | +``` |
| 28 | +fix(deps): bump bundled PowerShell module versions |
| 29 | +``` |
30 | 30 |
|
31 | | -Do NOT add `release-as` or `last-release-sha` to `release-please-config.json` unless |
32 | | -you need a one-time override (e.g. bootstrapping a new release track). These manually |
33 | | -lock the version and prevent RP from evaluating new commits correctly. |
| 31 | +For a one-time recovery, a commit body may contain the exact footer: |
34 | 32 |
|
35 | | -## Four-digit version fields for Windows |
| 33 | +``` |
| 34 | +Release-As: 3.24.2 |
| 35 | +``` |
36 | 36 |
|
37 | | -The .NET project uses these MSBuild properties in `phonedesk.csproj`: |
| 37 | +Use that footer only to recover a known pending release. Do not add a persistent |
| 38 | +`release-as` override to `release-please-config.json`; it would lock normal version |
| 39 | +calculation. |
38 | 40 |
|
39 | | -```xml |
40 | | -<Version>3.21.3</Version> <!-- SemVer — must match RP tag exactly --> |
41 | | -<AssemblyVersion>3.21.3.0</AssemblyVersion> <!-- 4-part for Windows compatibility --> |
42 | | -<FileVersion>3.21.3.0</FileVersion> <!-- 4-part for Windows compatibility --> |
43 | | -``` |
| 41 | +## Application version sources |
44 | 42 |
|
45 | | -- **`<Version>`** is 3-part SemVer and must match the release-please tag (e.g. `v3.21.3`). |
46 | | -- **`<AssemblyVersion>` / `<FileVersion>`** use 4-part versions (e.g. `3.21.3.0`) because |
47 | | - Windows requires four digits. The CI validation in `build.yml` accepts either `X.Y.Z` or |
48 | | - `X.Y.Z.0` for these properties (see the `validate-release` job). |
| 43 | +The application-facing sources must agree on the same three-part version: |
| 44 | + |
| 45 | +- `version.txt` |
| 46 | +- `phonedesk.csproj` `<Version>` |
| 47 | +- `app.manifest`'s four-part `assemblyIdentity` version |
| 48 | +- `src/PhoneDesk.Domain/ConstantsService.cs` |
| 49 | +
|
| 50 | +`phonedesk.csproj` keeps four-part `<AssemblyVersion>` and `<FileVersion>` values for |
| 51 | +Windows compatibility. Run `bash scripts/validate-version-sync.sh` to check these |
| 52 | +sources. Both `scripts/bump-version.sh` and `scripts/bump-version.ps1` update |
| 53 | +`version.txt` along with the other application sources. |
| 54 | +
|
| 55 | +`.release-please-manifest.json` is release-please-managed state. It may trail the |
| 56 | +application sources while a release is waiting to be proposed, but |
| 57 | +`validate-release` requires it to match the release tag. |
49 | 58 |
|
50 | 59 | ## Key files |
51 | 60 |
|
52 | 61 | | File | Purpose | |
53 | 62 | |------|---------| |
54 | | -| `.github/workflows/build.yml` | CI/CD pipeline: RP, validation, build, publish, Homebrew | |
55 | | -| `release-please-config.json` | RP config: release-type, extra-files, draft mode | |
56 | | -| `.release-please-manifest.json` | Current package version (auto-managed by RP) | |
57 | | -| `version.txt` | Human-readable version (must match RP version) | |
| 63 | +| `.github/workflows/build.yml` | CI/CD pipeline: release-please, validation, build, publish, Homebrew | |
| 64 | +| `.github/workflows/module-compatibility.yml` | Weekly module pin check and releaseable dependency PR | |
| 65 | +| `release-please-config.json` | Release-please config: release type, anchor, extra files, draft mode | |
| 66 | +| `.release-please-manifest.json` | Release-please-managed package version | |
| 67 | +| `version.txt` | Application version source | |
| 68 | +| `scripts/validate-version-sync.sh` | Cross-platform application version-source guard | |
58 | 69 | | `phonedesk.csproj` | Project `<Version>`, `<AssemblyVersion>`, `<FileVersion>` | |
59 | 70 |
|
60 | 71 | ## What happens on a push to `main` |
61 | 72 |
|
62 | | -1. **`release-please` job**: RP evaluates commits since `last-release-sha`, creates or |
63 | | - updates a release PR (branch: `release-please--branches--main`). |
64 | | -2. **PR validation**: The `pr-validate` job builds + tests the PR across all runtimes |
65 | | - (Windows, macOS Intel, macOS ARM, Linux). |
66 | | -3. **When the release PR is merged**: RP creates a Git tag and a draft GitHub release, |
67 | | - then the full `build` → `upload-release-assets` → `bump-homebrew-cask` pipeline runs. |
| 73 | +1. **`release-please` job**: release-please evaluates commits after |
| 74 | + `last-release-sha` and creates or updates a release PR |
| 75 | + (branch: `release-please--branches--main`). |
| 76 | +2. **PR validation**: the `pr-validate` job checks version-source alignment, then |
| 77 | + builds and tests the PR across Windows, macOS Intel, macOS ARM, and Linux. |
| 78 | +3. **When the release PR is merged**: release-please creates the Git tag and draft |
| 79 | + GitHub release, then `build` → `upload-release-assets` → `bump-homebrew-cask` runs. |
68 | 80 |
|
69 | 81 | ## Troubleshooting |
70 | 82 |
|
71 | | -### RP keeps creating duplicate or phantom release PRs |
72 | | -- Verify `release-please-config.json` has `"last-release-sha"` pointing to the |
73 | | - **exact commit** of the most recent release tag (under the `packages."."` key). |
74 | | -- Verify the action is pinned to a **v4 commit SHA**, not a floating `v4` tag. |
75 | | -- Delete stale RP branches (`release-please--branches--main-*`) and re-run. |
| 83 | +### Release-please does not create a release PR |
76 | 84 |
|
77 | | -### Validate-release fails with "Version is not a stable semantic version" |
78 | | -- Ensure the release tag matches `vX.Y.Z` format (no pre-release suffixes, no fourth |
79 | | - digit). |
80 | | -- Check that `<Version>` in `phonedesk.csproj` matches the tag exactly (3 parts). |
| 85 | +- Check that the merged change uses a releaseable type such as `fix`, `feat`, or |
| 86 | + `fix(deps)`, rather than an ordinary `chore`. |
| 87 | +- For a known pending version, use a one-time `Release-As: X.Y.Z` footer. |
| 88 | +- Verify `release-please-config.json` has the root-level `last-release-sha` pointing to |
| 89 | + the intended release anchor. |
| 90 | +- Delete stale release-please branches (`release-please--branches--main-*`) only after |
| 91 | + inspecting their PR and branch state. |
| 92 | +
|
| 93 | +### Validate-release fails with a version mismatch |
| 94 | +
|
| 95 | +- Ensure the release tag matches `vX.Y.Z` format with no pre-release suffix or fourth |
| 96 | + digit. |
| 97 | +- Run `bash scripts/validate-version-sync.sh X.Y.Z` locally. |
| 98 | +- Check that `.release-please-manifest.json` contains the same three-part version as the |
| 99 | + release tag. |
81 | 100 |
|
82 | 101 | ### Windows builds fail on version mismatch |
83 | | -- `<AssemblyVersion>` and `<FileVersion>` must be 4-part (e.g. `3.21.3.0`). Windows |
84 | | - does not accept 3-part assembly versions. |
| 102 | +
|
| 103 | +- `<AssemblyVersion>` and `<FileVersion>` must be four-part values such as `3.21.3.0`. |
| 104 | +- `<Version>` remains three-part and must match the release tag exactly. |
0 commit comments