From 4827505b074dd27576573830040c62fc9d4c6e3a Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Tue, 19 May 2026 19:14:51 -0400 Subject: [PATCH] check-version-bump: fall back to App.csproj when Directory.Build.props missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bootstrap fix for the v1.10.0 -> v1.11.0 release PR (#341). PR #315 (the version-unification refactor that introduced Directory.Build.props) landed on dev AFTER v1.10.0 was tagged, so main has never seen Directory.Build.props — the main-side checkout step fails on Get-Content with "Cannot find path". Test-Path now prefers Directory.Build.props and falls back to the legacy App.csproj location. Becomes dead code after #341 lands on main, but harmless and self-documenting. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/check-version-bump.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index a8ef8ea..c722ea7 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -16,9 +16,14 @@ jobs: id: pr shell: pwsh run: | - $version = ([xml](Get-Content src/Directory.Build.props)).Project.PropertyGroup.Version | Where-Object { $_ } + # Prefer Directory.Build.props; fall back to App.csproj for branches that + # predate the version-unification refactor (PR #315). + $ddb = 'src/Directory.Build.props' + $app = 'src/PlanViewer.App/PlanViewer.App.csproj' + $path = if (Test-Path $ddb) { $ddb } else { $app } + $version = ([xml](Get-Content $path)).Project.PropertyGroup.Version | Where-Object { $_ } echo "VERSION=$version" >> $env:GITHUB_OUTPUT - Write-Host "PR version: $version" + Write-Host "PR version: $version (from $path)" - name: Checkout main uses: actions/checkout@v5 @@ -30,9 +35,12 @@ jobs: id: main shell: pwsh run: | - $version = ([xml](Get-Content main-branch/src/Directory.Build.props)).Project.PropertyGroup.Version | Where-Object { $_ } + $ddb = 'main-branch/src/Directory.Build.props' + $app = 'main-branch/src/PlanViewer.App/PlanViewer.App.csproj' + $path = if (Test-Path $ddb) { $ddb } else { $app } + $version = ([xml](Get-Content $path)).Project.PropertyGroup.Version | Where-Object { $_ } echo "VERSION=$version" >> $env:GITHUB_OUTPUT - Write-Host "Main version: $version" + Write-Host "Main version: $version (from $path)" - name: Compare versions env: @@ -42,7 +50,7 @@ jobs: echo "Main version: $MAIN_VERSION" echo "PR version: $PR_VERSION" if [ "$PR_VERSION" == "$MAIN_VERSION" ]; then - echo "::error::Version in PlanViewer.App.csproj ($PR_VERSION) has not changed from main. Bump the version before merging to main." + echo "::error::Version ($PR_VERSION) has not changed from main. Bump the version before merging to main." exit 1 fi echo "✅ Version bumped: $MAIN_VERSION → $PR_VERSION"