From 021d26f1dd4f2b588df8c1b403712771b1ddf837 Mon Sep 17 00:00:00 2001 From: Adrian Hall Date: Thu, 29 Aug 2024 10:03:24 -0700 Subject: [PATCH] Add release spec for github action --- .github/workflows/build-library.yml | 2 +- .github/workflows/build-template.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-library.yml b/.github/workflows/build-library.yml index 041b35f..5c47ded 100644 --- a/.github/workflows/build-library.yml +++ b/.github/workflows/build-library.yml @@ -192,7 +192,7 @@ jobs: --azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}" --azure-key-vault-tenant-id ${{ secrets.SIGN_TENANT_ID }} --azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}" - --verbosity Information + --verbosity Information - name: Upload signed NuGet packages uses: actions/upload-artifact@v4 diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml index 3d62760..8c444b0 100644 --- a/.github/workflows/build-template.yml +++ b/.github/workflows/build-template.yml @@ -146,3 +146,29 @@ jobs: --api-key dummy --source MainLatest --skip-duplicate + + release: + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: [ sign ] + environment: nuget-release-gate + runs-on: ubuntu-latest + + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download unsigned NuGet packages + uses: actions/download-artifact@v4 + with: + name: nuget-signed + path: ${{ github.workspace }}/packages + + - name: Push signed packages to NuGet.org + run: > + dotnet nuget push + ${{ github.workspace }}/packages/**/*.nupkg + --source https://api.nuget.org/v3/index.json + --api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }} + --skip-duplicate