Skip to content

Commit

Permalink
Fail if signing fails
Browse files Browse the repository at this point in the history
Check the exit code of `sign` and fail the workflow if it does.
  • Loading branch information
martincostello committed Sep 26, 2024
1 parent f7dc35f commit 47284e8
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,25 @@ jobs:

- name: Sign artifacts
shell: pwsh
run: >
./sign code azure-key-vault
**/*.nupkg
--base-directory "${{ github.workspace }}/packages"
--file-list "${{ github.workspace }}/signing-config/filelist.txt"
--application-name "Polly"
--publisher-name "App vNext"
--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' }}"
run: |
./sign code azure-key-vault `
**/*.nupkg `
--base-directory "${{ github.workspace }}/packages" `
--file-list "${{ github.workspace }}/signing-config/filelist.txt" `
--application-name "Polly" `
--publisher-name "App vNext" `
--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) {
Write-Output "::error::Failed to sign NuGet packages"
exit 1
}
- name: Upload signed packages
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
Expand Down

0 comments on commit 47284e8

Please sign in to comment.