Skip to content

Commit b5b2891

Browse files
Update build-and-sign.yml
1 parent a7c4733 commit b5b2891

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/build-and-sign.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
path: src/AClassLibrary/bin/Release/**/*.nupkg
3434

3535
sign:
36+
if: ${{ github.ref == 'ref/heads/main' }} # Only run this job on the main branch
3637
permissions:
3738
id-token: write # Required for requesting the JWT
3839

@@ -43,11 +44,13 @@ jobs:
4344
uses: actions/download-artifact@v3
4445
with:
4546
name: config
47+
path: config
4648

4749
- name: Download build artifacts
4850
uses: actions/download-artifact@v3
4951
with:
5052
name: BuildArtifacts
53+
path: BuildArtifacts
5154

5255
- name: Setup .NET
5356
uses: actions/setup-dotnet@v3
@@ -65,3 +68,21 @@ jobs:
6568
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
6669
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6770

71+
- name: Sign artifacts
72+
run: >
73+
sign code azure-key-vault
74+
**/*.nupkg
75+
--timestamp-url "http://timestamp.digicert.com"
76+
--base-directory "BuildArtifacts"
77+
--file-list "config/filelist.txt"
78+
--publisher-name "CodeSignDemo"
79+
--description "CodeSignDemo"
80+
--description-url "https://github.com/novotnyllc/CodeSignDemo"
81+
--azure-key-vault-managed-identity true
82+
--azure-key-vault-url "${{ secrets.KEY_VAULT_CERTIFICATE_ID }}"
83+
84+
- name: Upload build artifacts
85+
uses: actions/upload-artifact@v3
86+
with:
87+
name: SignedArtifacts
88+
path: BuildArtifacts

0 commit comments

Comments
 (0)