Skip to content

Commit a0f3ef0

Browse files
committed
Sign nuget package using dotnet sign tool
1 parent 9434246 commit a0f3ef0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
pull_request:
66
branches: [ main ]
77

8+
permissions:
9+
contents: read
10+
id-token: write
11+
812
jobs:
913

1014
build:
@@ -32,6 +36,16 @@ jobs:
3236
- name: setup msbuild
3337
uses: microsoft/setup-msbuild@v2
3438

39+
- name: setup dotnet sign
40+
run: dotnet tool install --tool-path . --prerelease sign
41+
42+
- name: azure login
43+
uses: azure/login@v2
44+
with:
45+
client-id: ${{ secrets.TRUSTED_SIGNING_CLIENT_ID }}
46+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
47+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48+
3549
- name: build
3650
run: dotnet build -c ${{ env.Configuration }}
3751

@@ -41,6 +55,18 @@ jobs:
4155
- name: pack
4256
run: dotnet pack --no-build --no-restore src/NetOfficeFw.Build.csproj -c ${{ env.Configuration }} -o dist
4357

58+
- name: sign
59+
run: >
60+
./sign code trusted-signing
61+
**/*.nupkg
62+
--base-directory "${{ github.workspace }}/dist"
63+
--publisher-name "NetOffice"
64+
--description "NetOffice Build Tasks"
65+
--description-url "https://github.com/NetOfficeFw/BuildTasks/"
66+
--trusted-signing-endpoint "https://weu.codesigning.azure.net/"
67+
--trusted-signing-account "OpenSourceSigning"
68+
--trusted-signing-certificate-profile "JozefIzsoOpenSourceProfile"
69+
4470
- name: archive
4571
if: always()
4672
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)