From 38bc46677ea13b501f3fe39dca21d54ce2212e84 Mon Sep 17 00:00:00 2001 From: Daniel Bohlin Date: Wed, 29 Apr 2026 10:11:00 +0200 Subject: [PATCH] fix(ci): split Pack step to fix prerelease version mismatch Pattern adopted from Tharga.Blazor/Mcp/Wpf. The single Pack step in the Crawler reference template always stamps the stable version; on a PR run the prerelease job would push that stable .nupkg under a pre-release tag, and --skip-duplicate would then block the actual master release. Now the build job packs the stable version only on push to master, and the pre-release version only on pull_request. --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f94002a..82bdedf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,11 +100,18 @@ jobs: echo "version=$PRE_VERSION" >> "$GITHUB_OUTPUT" echo "Computed pre-release version: $PRE_VERSION" - - name: Pack + - name: Pack (stable — push to master) + if: github.ref == 'refs/heads/master' && github.event_name == 'push' shell: bash run: | dotnet pack Tharga.Reporter/Tharga.Reporter.csproj -c Release --no-build -o ./artifacts -p:PackageVersion=${{ steps.version.outputs.version }} + - name: Pack (pre-release — pull request) + if: github.event_name == 'pull_request' + shell: bash + run: | + dotnet pack Tharga.Reporter/Tharga.Reporter.csproj -c Release --no-build -o ./artifacts -p:PackageVersion=${{ steps.preversion.outputs.version }} + - name: Upload artifacts uses: actions/upload-artifact@v4 with: