Release v1.4.1 #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v4 | |
| - name: Get PR version | |
| id: pr | |
| shell: pwsh | |
| run: | | |
| $version = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ } | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| Write-Host "PR version: $version" | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| path: main-branch | |
| - name: Get main version | |
| id: main | |
| shell: pwsh | |
| run: | | |
| $version = ([xml](Get-Content main-branch/src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ } | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| Write-Host "Main version: $version" | |
| - 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 in PlanViewer.App.csproj ($PR_VERSION) has not changed from main. Bump the version before merging to main." | |
| exit 1 | |
| fi | |
| echo "✅ Version bumped: $MAIN_VERSION → $PR_VERSION" |