|
24 | 24 | id: setup-build |
25 | 25 | run: echo "build-suffix=${{ github.event_name == 'push' && env.CiRunPushSuffix || github.event_name == 'pull_request' && env.CiRunPullSuffix || null }}" >> "$GITHUB_OUTPUT" |
26 | 26 |
|
| 27 | + check-semver: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + if: github.event_name == 'pull_request' |
| 30 | + steps: |
| 31 | + - name: Checkout current version |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + |
| 36 | + - name: Find previous release |
| 37 | + id: previous-release |
| 38 | + env: |
| 39 | + GH_TOKEN: ${{ github.token }} |
| 40 | + run: | |
| 41 | + echo "RELEASE_NAME=$(gh release list -L 1 --json tagName -q .[0].tagName)" >> $GITHUB_OUTPUT |
| 42 | + - name: Checkout last release version |
| 43 | + uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + ref: ${{ steps.previous-release.outputs.RELEASE_NAME }} |
| 46 | + path: last-release |
| 47 | + sparse-checkout: | |
| 48 | + Directory.Build.props |
| 49 | + sparse-checkout-cone-mode: false |
| 50 | + |
| 51 | + - name: Extract Versions |
| 52 | + id: extract-versions |
| 53 | + run: | |
| 54 | + echo "CURRENT_VERSION=$(cat ./Directory.Build.props | grep -Po '(?<=VersionPrefix>).*(?=</VersionPrefix>)')" >> $GITHUB_OUTPUT |
| 55 | + echo "PREVIOUS_VERSION=$(cat ./last-release/Directory.Build.props | grep -Po '(?<=VersionPrefix>).*(?=</VersionPrefix>)')" >> $GITHUB_OUTPUT |
| 56 | + - name: Setup Python |
| 57 | + uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version: "3.10.12" |
| 60 | + |
| 61 | + - name: Install semver |
| 62 | + run: python -m pip install semver |
| 63 | + |
| 64 | + - name: Compare Versions |
| 65 | + run: .github/workflows/compare_version_numbers.sh |
| 66 | + |
27 | 67 | build: |
28 | | - needs: [setup] |
| 68 | + needs: [setup, check-semver] |
| 69 | + if: always() && !failure() && !cancelled() |
29 | 70 | strategy: |
30 | 71 | fail-fast: false |
31 | 72 | matrix: |
|
71 | 112 | permissions: |
72 | 113 | packages: write |
73 | 114 | needs: [build] |
74 | | - if: github.event_name == 'push' || github.event_name == 'release' |
| 115 | + if: (github.event_name == 'push' || github.event_name == 'release') && always() && !failure() && !cancelled() |
75 | 116 | steps: |
76 | 117 | - name: Setup .NET |
77 | 118 | uses: actions/setup-dotnet@v4 |
|
0 commit comments