Skip to content

Commit

Permalink
Test signing
Browse files Browse the repository at this point in the history
Testing for #2319.
  • Loading branch information
martincostello committed Oct 1, 2024
1 parent 3ebbd45 commit 02c08c1
Showing 1 changed file with 5 additions and 44 deletions.
49 changes: 5 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

env:
# HACK Running on Windows instead of Linux due to https://github.com/stryker-mutator/stryker-net/issues/2741
RUN_MUTATION_TESTS: ${{ matrix.os_name == 'windows' && !startsWith(github.ref, 'refs/tags/') && 'true' || 'false' }}
RUN_MUTATION_TESTS: 'false'

outputs:
dotnet-sdk-version: ${{ steps.setup-dotnet.outputs.dotnet-version }}
Expand Down Expand Up @@ -163,9 +163,6 @@ jobs:
sign:
needs: [ build, validate-packages ]
runs-on: windows-latest
if: |
github.event.repository.fork == false &&
startsWith(github.ref, 'refs/tags/')

steps:

Expand Down Expand Up @@ -193,6 +190,10 @@ jobs:

- name: Sign artifacts
shell: pwsh
env:
AZURE_CLIENT_ID: ${{ secrets.SIGN_CLI_APPLICATION_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.SIGN_CLI_SECRET }}
AZURE_TENANT_ID: ${{ secrets.SIGN_CLI_TENANT_ID }}
run: |
./sign code azure-key-vault `
**/*.nupkg `
Expand All @@ -203,9 +204,6 @@ jobs:
--description "Polly" `
--description-url "https://github.com/${{ github.repository }}" `
--azure-key-vault-certificate "${{ secrets.SIGN_CLI_CERT_NAME }}" `
--azure-key-vault-client-id "${{ secrets.SIGN_CLI_APPLICATION_ID }}" `
--azure-key-vault-client-secret "${{ secrets.SIGN_CLI_SECRET }}" `
--azure-key-vault-tenant-id "${{ secrets.SIGN_CLI_TENANT_ID }}" `
--azure-key-vault-url "${{ secrets.SIGN_CLI_VAULT_URI }}" `
--verbosity "${{ runner.debug == '1' && 'Debug' || 'Warning' }}"
if ($LASTEXITCODE -ne 0) {
Expand Down Expand Up @@ -334,40 +332,3 @@ jobs:
} else {
Write-Output "All $($packages.Length) NuGet packages have valid signatures."
}
publish-nuget:
needs: [ build, validate-signed-packages ]
runs-on: ubuntu-latest
steps:

- name: Download signed packages
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: signed-packages

- name: Setup .NET SDK
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: ${{ needs.build.outputs.dotnet-sdk-version }}

- name: Push signed NuGet packages to NuGet.org
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source https://api.nuget.org/v3/index.json

- name: Generate GitHub application token
id: generate-application-token
uses: peter-murray/workflow-application-token-action@dc0413987a085fa17d19df9e47d4677cf81ffef3 # v3.0.0
with:
application_id: ${{ secrets.POLLY_UPDATER_BOT_APP_ID }}
application_private_key: ${{ secrets.POLLY_UPDATER_BOT_KEY }}
permissions: 'contents:write'

- name: Publish nuget_packages_published
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
event-type: nuget_packages_published
token: ${{ steps.generate-application-token.outputs.token }}
client-payload: |-
{
"packages": "${{ needs.build.outputs.package-names }}",
"version": "${{ needs.build.outputs.package-version }}"
}

0 comments on commit 02c08c1

Please sign in to comment.