Skip to content

Release: web parallelism icons, SSMS extension, connect-dialog DB, hardening #75

Release: web parallelism icons, SSMS extension, connect-dialog DB, hardening

Release: web parallelism icons, SSMS extension, connect-dialog DB, hardening #75

name: Check version bump
on:
pull_request:
branches: [main]
jobs:
check-version:
if: github.head_ref == 'dev'
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v5
- name: Get PR version
id: pr
shell: pwsh
run: |
# 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 (from $path)"
- name: Checkout main
uses: actions/checkout@v5
with:
ref: main
path: main-branch
- name: Get main version
id: main
shell: pwsh
run: |
$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 (from $path)"
- name: Compare versions
env:
PR_VERSION: ${{ steps.pr.outputs.VERSION }}
MAIN_VERSION: ${{ steps.main.outputs.VERSION }}
run: |
echo "Main version: $MAIN_VERSION"
echo "PR version: $PR_VERSION"
if [ "$PR_VERSION" == "$MAIN_VERSION" ]; then
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"