Skip to content

Commit 2e43a1c

Browse files
committed
fix shared release version prefix
1 parent d43aec9 commit 2e43a1c

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

.github/workflows/release-publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ jobs:
6161
id: resolve_version
6262
shell: bash
6363
run: |
64-
version_prefix="$(dotnet msbuild ./DotPilot/DotPilot.csproj -getProperty:ApplicationDisplayVersion | tail -n 1 | tr -d '\r')"
64+
version_prefix="$(dotnet msbuild ./DotPilot/DotPilot.csproj -getProperty:DotPilotVersionPrefix | tail -n 1 | tr -d '\r')"
6565
if [[ ! "${version_prefix}" =~ ^[0-9]+\.[0-9]+$ ]]; then
66-
echo "ApplicationDisplayVersion must be a two-segment numeric prefix. Found: '${version_prefix}'." >&2
66+
echo "DotPilotVersionPrefix must be a two-segment numeric prefix. Found: '${version_prefix}'." >&2
6767
exit 1
6868
fi
6969
@@ -129,8 +129,8 @@ jobs:
129129
-p:PackageFormat=dmg \
130130
-p:CodesignKey=- \
131131
-p:DiskImageSigningKey=- \
132-
-p:ApplicationDisplayVersion=${{ needs.prepare_release.outputs.release_version }} \
133-
-p:ApplicationVersion=${{ needs.prepare_release.outputs.application_version }}
132+
-p:DotPilotReleaseVersion=${{ needs.prepare_release.outputs.release_version }} \
133+
-p:DotPilotBuildNumber=${{ needs.prepare_release.outputs.application_version }}
134134
135135
- name: Stage macOS Release Asset
136136
shell: bash
@@ -186,8 +186,8 @@ jobs:
186186
-p:PublishSingleFile=true
187187
-p:IncludeNativeLibrariesForSelfExtract=true
188188
-p:IncludeAllContentForSelfExtract=true
189-
-p:ApplicationDisplayVersion=${{ needs.prepare_release.outputs.release_version }}
190-
-p:ApplicationVersion=${{ needs.prepare_release.outputs.application_version }}
189+
-p:DotPilotReleaseVersion=${{ needs.prepare_release.outputs.release_version }}
190+
-p:DotPilotBuildNumber=${{ needs.prepare_release.outputs.application_version }}
191191
192192
- name: Stage Windows Release Asset
193193
shell: pwsh
@@ -254,8 +254,8 @@ jobs:
254254
-p:SelfContained=true \
255255
-p:PackageFormat=snap \
256256
-p:UnoSnapcraftAdditionalParameters=--destructive-mode \
257-
-p:ApplicationDisplayVersion=${{ needs.prepare_release.outputs.release_version }} \
258-
-p:ApplicationVersion=${{ needs.prepare_release.outputs.application_version }}
257+
-p:DotPilotReleaseVersion=${{ needs.prepare_release.outputs.release_version }} \
258+
-p:DotPilotBuildNumber=${{ needs.prepare_release.outputs.application_version }}
259259
260260
sudo chown -R "$USER:$USER" ./bin/Release/net10.0-desktop/linux-x64
261261

AGENTS.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,12 @@ For this app:
212212
- after changing GitHub rulesets, workflows, or release packaging, verify against the specific live blocked operation or failing run instead of assuming the policy or YAML change solved the issue
213213
- desktop app build or publish jobs must use native runners for their target OS: macOS artifacts on macOS runners, Windows artifacts on Windows runners, and Linux artifacts on Linux runners
214214
- desktop release assets must be native installable or directly executable outputs for each OS, not archives of raw publish folders; package the real `.exe`, `.snap`, `.dmg`, `.pkg`, `Setup.exe`, or equivalent runnable installer/app artifact instead of zipping intermediate publish directories
215-
- desktop release versions must use the `ApplicationDisplayVersion` value in `DotPilot/DotPilot.csproj` as a manually maintained two-segment prefix, with CI appending the final segment from the build number (for example `0.0.<build-number>`)
216-
- until the user explicitly changes the versioning policy, the manually maintained `ApplicationDisplayVersion` prefix for desktop releases must stay `0.0`, not `1.0`
217-
- the release workflow must not take ownership of the first two version segments; those remain manually edited in source, while CI supplies only the last numeric segment and matching release tag/application version values
215+
- desktop release version-prefix source of truth must live in `Directory.Build.props`, not as a separately maintained value in `DotPilot/DotPilot.csproj`
216+
- until the user explicitly changes the versioning policy, the shared desktop release version prefix must stay `0.0`
217+
- the release workflow must not take ownership of the human-managed prefix; CI may append only the final build segment to produce release versions such as `0.0.<build-number>`
218+
- keep `ApplicationDisplayVersion` aligned to the shared version prefix during normal project evaluation, and let CI override it only with the final three-segment release version
219+
- do not maintain a separate human-edited `ApplicationVersion` prefix in app projects; when packaging needs a build value, derive it from CI/build metadata instead of duplicating version authority
220+
- the production desktop app identifier must be `com.managed-code.dotpilot`
218221
- for CI and release automation in this solution, prefer existing `dotnet` and `MSBuild` capabilities plus small workflow-native steps over Python or adding a separate helper project for simple versioning and release-note tasks
219222
- prefer MIT-licensed GitHub and NuGet dependencies when they materially accelerate delivery and align with the current architecture
220223
- prefer official `.NET` AI evaluation libraries under `Microsoft.Extensions.AI.Evaluation*` for response-quality, tool-usage, and safety evaluation instead of custom or third-party evaluation stacks by default

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<LangVersion>14</LangVersion>
66

7+
<DotPilotVersionPrefix Condition="'$(DotPilotVersionPrefix)' == ''">0.0</DotPilotVersionPrefix>
8+
<DotPilotBuildNumber Condition="'$(DotPilotBuildNumber)' == ''">1</DotPilotBuildNumber>
9+
<DotPilotReleaseVersion Condition="'$(DotPilotReleaseVersion)' == ''">$(DotPilotVersionPrefix)</DotPilotReleaseVersion>
710

811
<EnableNETAnalyzers>true</EnableNETAnalyzers>
912
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

DotPilot/DotPilot.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<!-- Display name -->
1111
<ApplicationTitle>DotPilot</ApplicationTitle>
1212
<!-- App Identifier -->
13-
<ApplicationId>com.companyname.DotPilot</ApplicationId>
13+
<ApplicationId>com.managed-code.dotpilot</ApplicationId>
1414
<!-- Versions -->
15-
<ApplicationDisplayVersion>0.0</ApplicationDisplayVersion>
16-
<ApplicationVersion>1</ApplicationVersion>
15+
<ApplicationDisplayVersion>$(DotPilotReleaseVersion)</ApplicationDisplayVersion>
16+
<ApplicationVersion>$(DotPilotBuildNumber)</ApplicationVersion>
1717
<!-- Package Publisher -->
1818
<ApplicationPublisher>O=DotPilot</ApplicationPublisher>
1919
<!-- Package Description -->

docs/ADR/ADR-0002-split-github-actions-build-and-release.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ That shape no longer matches the repository workflow:
1616

1717
- normal validation should stay focused on build and test feedback
1818
- release publishing has different permissions, side effects, and operator intent
19-
- the release path now needs CI-derived version resolution from `DotPilot/DotPilot.csproj`
19+
- the release path now needs CI-derived version resolution from the shared version prefix in `Directory.Build.props`
2020
- desktop releases must publish platform artifacts and create a GitHub Release with feature-oriented notes
2121

2222
Keeping all of that in one catch-all workflow makes the automation harder to reason about, harder to secure, and harder to operate safely.
@@ -31,7 +31,7 @@ We will split GitHub Actions into two explicit workflows:
3131
- does not publish desktop artifacts or create releases
3232
2. `release-publish.yml`
3333
- runs automatically on pushes to `main`
34-
- resolves the release version from the two-segment `ApplicationDisplayVersion` prefix in `DotPilot/DotPilot.csproj` plus the GitHub Actions build number
34+
- resolves the release version from the two-segment `DotPilotVersionPrefix` value in `Directory.Build.props` plus the GitHub Actions build number
3535
- publishes desktop release assets for macOS, Windows, and Linux as real packaged outputs instead of raw publish-folder archives
3636
- uses `.dmg` for macOS, a self-contained single-file `.exe` for Windows, and `.snap` for Linux
3737
- creates the GitHub Release
@@ -73,7 +73,7 @@ This keeps unrelated concerns coupled and makes ordinary CI runs carry release-s
7373

7474
Rejected.
7575

76-
The repository still needs a manual source-of-truth prefix in `DotPilot/DotPilot.csproj`, but the final build segment should be CI-derived so every `main` release is unique without generating a release-only source commit.
76+
The repository still needs a manual source-of-truth prefix in `Directory.Build.props`, but the final build segment should be CI-derived so every `main` release is unique without generating a release-only source commit.
7777

7878
### 3. Store release notes entirely as manual workflow input
7979

@@ -94,7 +94,7 @@ That makes release quality depend on operator memory instead of repo-owned histo
9494
### Negative
9595

9696
- Release automation now depends on the GitHub Actions run number remaining a suitable build-number source for releases.
97-
- The repository gains workflow-owned release logic that must stay aligned with `DotPilot.csproj`, git history, and `docs/Features/`.
97+
- The repository gains workflow-owned release logic that must stay aligned with `Directory.Build.props`, project packaging metadata, git history, and `docs/Features/`.
9898

9999
## Implementation Impact
100100

0 commit comments

Comments
 (0)