Skip to content

Commit 03f5bfc

Browse files
authored
Merge pull request #163 from realgarit/realgar/fix-release-flow
fix: repair release flow and recover v3.24.2
2 parents c85154a + c62a7ec commit 03f5bfc

9 files changed

Lines changed: 286 additions & 88 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
steps:
6363
- name: Checkout release commit
64-
uses: actions/checkout@v7
64+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
6565
with:
6666
# Draft GitHub releases do not create their tag until publication.
6767
ref: ${{ needs.release-please.outputs.release_sha }}
@@ -80,30 +80,14 @@ jobs:
8080
fi
8181
8282
VERSION="${RELEASE_TAG#v}"
83-
VERSION_FILE="$(tr -d '[:space:]' < version.txt)"
84-
if [[ "$VERSION_FILE" != "$VERSION" ]]; then
85-
echo "::error::version.txt contains '$VERSION_FILE', expected '$VERSION'."
83+
bash scripts/validate-version-sync.sh "$VERSION"
84+
85+
MANIFEST_VERSION="$(jq -r '."."' .release-please-manifest.json)"
86+
if [[ "$MANIFEST_VERSION" != "$VERSION" ]]; then
87+
echo "::error::.release-please-manifest.json contains '$MANIFEST_VERSION', expected '$VERSION'."
8688
exit 1
8789
fi
8890
89-
for PROPERTY in Version AssemblyVersion FileVersion; do
90-
PROJECT_VERSION="$(sed -n "s:.*<$PROPERTY>\\([^<]*\\)</$PROPERTY>.*:\\1:p" phonedesk.csproj | head -1)"
91-
if [[ "$PROPERTY" == "Version" ]]; then
92-
# Version must match exactly (SemVer, 3 parts)
93-
if [[ "$PROJECT_VERSION" != "$VERSION" ]]; then
94-
echo "::error::$PROPERTY is '$PROJECT_VERSION', expected '$VERSION'."
95-
exit 1
96-
fi
97-
else
98-
# AssemblyVersion/FileVersion need 4 parts on Windows; accept either 3.21.3 or 3.21.3.0
99-
EXPECTED4="${VERSION}.0"
100-
if [[ "$PROJECT_VERSION" != "$VERSION" && "$PROJECT_VERSION" != "$EXPECTED4" ]]; then
101-
echo "::error::$PROPERTY is '$PROJECT_VERSION', expected '$VERSION' or '$EXPECTED4'."
102-
exit 1
103-
fi
104-
fi
105-
done
106-
10791
if [[ "$(git rev-parse HEAD)" != "$RELEASE_SHA" ]]; then
10892
echo "::error::Checked out commit does not match Release Please SHA '$RELEASE_SHA'."
10993
exit 1
@@ -138,12 +122,12 @@ jobs:
138122

139123
steps:
140124
- name: Checkout code
141-
uses: actions/checkout@v7
125+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
142126
with:
143127
ref: ${{ needs.release-please.outputs.release_sha }}
144128

145129
- name: Setup .NET
146-
uses: actions/setup-dotnet@v6
130+
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
147131
with:
148132
dotnet-version: '10.0.x'
149133

@@ -220,7 +204,7 @@ jobs:
220204
zip -r ../../dist/phonedesk-linux-x64.zip .
221205
222206
- name: Upload build artifacts
223-
uses: actions/upload-artifact@v7
207+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
224208
with:
225209
name: phonedesk-${{ matrix.runtime }}
226210
path: ./dist/*
@@ -237,7 +221,7 @@ jobs:
237221
steps:
238222
- name: Download all artifacts
239223
# Build jobs upload finished assets (zips / setup exe), so a flat merge is enough.
240-
uses: actions/download-artifact@v8
224+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
241225
with:
242226
pattern: phonedesk-*
243227
path: ./artifacts
@@ -285,7 +269,7 @@ jobs:
285269
if: needs.release-please.outputs.release_created == 'true'
286270
steps:
287271
- name: Checkout tap
288-
uses: actions/checkout@v7
272+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
289273
with:
290274
repository: realgarit/homebrew-tap
291275
token: ${{ secrets.PAT_TOKEN }}
@@ -371,14 +355,18 @@ jobs:
371355

372356
steps:
373357
- name: Checkout code
374-
uses: actions/checkout@v7
358+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
375359
with:
376360
# For PR events, use the head SHA (not the merge ref) to avoid race
377361
# where the merge ref is deleted before the runner picks up the job.
378362
ref: ${{ inputs.validate_ref || github.event.pull_request.head.sha || github.ref }}
379363

364+
- name: Validate version source alignment
365+
shell: bash
366+
run: bash scripts/validate-version-sync.sh
367+
380368
- name: Setup .NET
381-
uses: actions/setup-dotnet@v6
369+
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
382370
with:
383371
dotnet-version: '10.0.x'
384372

.github/workflows/module-compatibility.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout code
22-
uses: actions/checkout@v7
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2323

2424
- name: Setup .NET
25-
uses: actions/setup-dotnet@v6
25+
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
2626
with:
2727
dotnet-version: '10.0.x'
2828

@@ -84,9 +84,9 @@ jobs:
8484
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
8585
git checkout -b "$BRANCH"
8686
git add scripts/module-versions.json
87-
git commit -m "chore: bump bundled PowerShell module versions"
87+
git commit -m "fix(deps): bump bundled PowerShell module versions"
8888
git push origin "$BRANCH"
89-
gh pr create --title "chore: bump bundled PowerShell module versions" \
89+
gh pr create --title "fix(deps): bump bundled PowerShell module versions" \
9090
--body "$(cat <<EOF
9191
Weekly module compatibility check found newer versions on the PowerShell Gallery.
9292

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ Always: **branch → commit → push + open PR → CI green → merge (merge com
8686
- 2026-07-21 — **Microsoft Store**: EXE-app product `53a8f446-bbf3-4c01-9156-3ef5b44aaf57` in Partner Center. Package URLs must not redirect → installers copied to `gh-pages` branch `store/<version>/`, served from `https://realgarit.github.io/phonedesk/...`; listing screenshots generated via `GENERATE_SCREENSHOTS=1 SCREENSHOT_FRAMELESS=1`. Store's automated silent-install/ARP checks can't see per-user (HKCU) installs — those warnings are expected; verify manually. Pending: automate gh-pages copy + Store submission API in build.yml; code-signing cert (Azure Trusted/Artifact Signing unavailable to Swiss individuals — classic CA needed, SSL.com eSigner favored); Kaspersky Allowlist submission after signing.
8787
- 2026-07-21 — Open PR #148 (module-compatibility bot) predates the rebrand and needs a rebase onto renamed paths before merge.
8888
- 2026-07-23 — MS Store cert 10.1.1.1 also rejected the "PhoneDesk for Microsoft Teams" Store-name form: the Store product-name field may not contain any Microsoft product name at all. Listing changed to bare "PhoneDesk" and resubmitted; "for Microsoft Teams" remains only in the Store description/keywords and in-app branding.
89+
- 2026-08-10 — **Bundled-module update #161 and version bump #162 merged**: `scripts/module-versions.json` now pins the five Microsoft.Graph modules to `2.39.0`; app version sources are `3.24.2`. Both PRs passed the full platform/review gates and the local suite ran 541 tests. Live release verification found no `v3.24.2`: release-please ignored the merged `chore:` commits as non-user-facing, and `version.txt` remains `3.24.0`; repair the release trigger/version-file alignment before claiming delivery.

docs/release-please-setup.md

Lines changed: 72 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,103 @@
22

33
This project uses [release-please](https://github.com/googleapis/release-please) (via the
44
`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.
77

8-
## Version pinning (fixed at v4)
8+
## Version pinning
99

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:
1111

12-
```
13-
uses: googleapis/release-please-action@8b8fd2cc23b2e18957157a9d923d75aa0c6f6ad5 # v4
12+
```yaml
13+
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
1414
```
1515
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.
2020

21-
## Preventing phantom major-version bumps
21+
## Commit types and one-time recovery
2222

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:
2626

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+
```
3030

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:
3432

35-
## Four-digit version fields for Windows
33+
```
34+
Release-As: 3.24.2
35+
```
3636

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.
3840

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
4442

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.
4958
5059
## Key files
5160
5261
| File | Purpose |
5362
|------|---------|
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 |
5869
| `phonedesk.csproj` | Project `<Version>`, `<AssemblyVersion>`, `<FileVersion>` |
5970
6071
## What happens on a push to `main`
6172
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.
6880
6981
## Troubleshooting
7082
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
7684
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.
81100
82101
### 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

Comments
 (0)