From 50da391367e29a664a16446dad84735c2f15c5ac Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Mon, 23 Jun 2025 12:27:38 +0300 Subject: [PATCH 1/2] Publish main to public nuget --- .github/workflows/dotnet-build.yml | 31 ++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 59d8b15cbf..228f88ed28 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -263,7 +263,7 @@ jobs: sign: needs: [build_library] - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: ${{ startsWith(github.ref, 'refs/tags/') }} || (github.event_name != 'pull_request') runs-on: windows-latest permissions: id-token: write # Required for requesting the JWT @@ -335,7 +335,34 @@ jobs: path: | ${{ github.workspace }}/packages/**/*.nupkg - release: + release-main: + if: github.event_name != 'pull_request' && ${{ !startsWith(github.ref, 'refs/tags/') }} + needs: [sign] + runs-on: ubuntu-latest + + steps: + - name: Install .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.TOOLKIT_NET_VERSION }} + dotnet-quality: 'ga' + + - name: Download signed packages + uses: actions/download-artifact@v4 + with: + name: signed-packages + path: ./packages + + - name: Upload artifact + if: github.event_name != 'pull_request' + run: | + dotnet nuget push + **/*.nupkg + --source "https://nuget.pkg.github.com/CommunityToolkit/index.json" + --api-key ${{ secrets.GITHUB_TOKEN }} + --skip-duplicate + + release-nuget: if: ${{ startsWith(github.ref, 'refs/tags/') }} needs: [sign] environment: nuget-release-gate # This gates this job until manually approved From a3fc41fa8277b452e6da6e65b001be8d226e12d8 Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Mon, 23 Jun 2025 12:46:44 +0300 Subject: [PATCH 2/2] fix conditions --- .github/workflows/dotnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 228f88ed28..ef04a77cda 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -263,7 +263,7 @@ jobs: sign: needs: [build_library] - if: ${{ startsWith(github.ref, 'refs/tags/') }} || (github.event_name != 'pull_request') + if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name != 'pull_request') }} runs-on: windows-latest permissions: id-token: write # Required for requesting the JWT @@ -336,7 +336,7 @@ jobs: ${{ github.workspace }}/packages/**/*.nupkg release-main: - if: github.event_name != 'pull_request' && ${{ !startsWith(github.ref, 'refs/tags/') }} + if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') }} needs: [sign] runs-on: ubuntu-latest