Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/check-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
Loading