From 5a88b3b87581c3bbeb5b6e322c07f9c78d032a80 Mon Sep 17 00:00:00 2001 From: Simon Sabin <1209963+simonsabin@users.noreply.github.com> Date: Fri, 19 Jun 2026 15:43:08 +0100 Subject: [PATCH] Change publish conditions to check for changes --- .github/workflows/publish-Oauth2Client-package.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-Oauth2Client-package.yml b/.github/workflows/publish-Oauth2Client-package.yml index 9e1a050b..5c0e8249 100644 --- a/.github/workflows/publish-Oauth2Client-package.yml +++ b/.github/workflows/publish-Oauth2Client-package.yml @@ -112,7 +112,7 @@ jobs: GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Update csproj version - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: | NEW_VERSION="${{steps.calc_version.outputs.version}}" sed -i "s/.*<\/Version>/$NEW_VERSION<\/Version>/" \ @@ -121,33 +121,33 @@ jobs: working-directory: Xero-NetStandard - name: Setup .NET - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: dotnet restore working-directory: Xero-NetStandard - name: Build - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: dotnet build --no-restore working-directory: Xero-NetStandard - name: Create OAuth2Client Package for Nuget.org - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: dotnet pack ./Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj working-directory: Xero-NetStandard - name: Publish OAuth2Client Package to Nuget.org - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: dotnet nuget push ./Xero.NetStandard.OAuth2Client/bin/Release/Xero.NetStandard.OAuth2Client.${{steps.calc_version.outputs.version}}.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json working-directory: Xero-NetStandard - name: Commit, Push and Tag - if: steps.calc_version.outputs.should_publish == 'true' + if: steps.check_changes.outputs.has_changes == 'true' run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com"