Skip to content

Commit d4d2de4

Browse files
committed
Rework nuget packages signing to use Azure Trusted Signing service
1 parent 0a9cee9 commit d4d2de4

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ permissions:
1010

1111
jobs:
1212
release:
13+
environment: production
14+
1315
runs-on: windows-2022
1416

1517
strategy:
@@ -45,13 +47,13 @@ jobs:
4547
path: ~/.dotnet/tools
4648
key: dotnettools
4749

48-
- name: Setup AzureSignTool
50+
- name: Setup dotnet sign tool
4951
if: steps.cache-dotnettools.outputs.cache-hit != 'true'
50-
run: dotnet tool install --verbosity minimal --global azuresigntool --version 6.0.1
52+
run: dotnet tool install --verbosity minimal --global sign --version 0.9.1-beta.24529.1
5153

52-
- name: Setup NuGetKeyVaultSignTool
54+
- name: Setup Knapcode.CertificateExtractor tool
5355
if: steps.cache-dotnettools.outputs.cache-hit != 'true'
54-
run: dotnet tool install --verbosity minimal --global NuGetKeyVaultSignTool --version 3.2.3
56+
run: dotnet tool install --verbosity minimal --global Knapcode.CertificateExtractor --version 0.1.1
5557

5658
- name: Cache packages
5759
uses: actions/cache@v4
@@ -99,36 +101,36 @@ jobs:
99101
path: '${{ github.workspace }}\Source\ClientApplication\bin\${{ matrix.configuration }}'
100102

101103
- name: Pack NetOffice
102-
if: steps.build.outputs.publish_nuget == 'true'
103104
run: |
104105
dotnet pack --no-build --no-restore Source\NetOffice.sln -c ${{ matrix.configuration }} -o dist
105106
env:
106107
VersionSuffix: ${{ steps.build.outputs.app_version_suffix }}
107108

108-
# - name: Sign NetOffice packages
109-
# if: success() && steps.build.outputs.publish_nuget == 'true' && steps.build.outputs.sign_binaries == 'true'
110-
# working-directory: '${{ github.workspace}}\dist'
111-
# run: |
112-
# NuGetKeyVaultSignTool.exe sign *.nupkg `
113-
# --file-digest sha256 `
114-
# --timestamp-rfc3161 http://timestamp.digicert.com `
115-
# --timestamp-digest sha256 `
116-
# --azure-key-vault-url https://opensourcesigning.vault.azure.net `
117-
# --azure-key-vault-tenant-id "${{ secrets.KEYVAULT_TENANT_ID }}" `
118-
# --azure-key-vault-client-id "${{ secrets.KEYVAULT_CLIENT_ID }}" `
119-
# --azure-key-vault-client-secret "${{ secrets.KEYVAULT_CLIENT_SECRET }}" `
120-
# --azure-key-vault-certificate "goITSolutions-until-2024-01"
109+
- name: Sign NetOffice packages
110+
if: success() && steps.build.outputs.sign_binaries == 'true'
111+
working-directory: '${{ github.workspace}}\dist'
112+
run: |
113+
sign code trusted-signing *.nupkg `
114+
--publisher-name "NetOffice" `
115+
--description "NetOffice" `
116+
--description-url "https://github.com/NetOfficeFw/NetOffice" `
117+
--trusted-signing-endpoint "${{ secrets.TRUSTED_SIGNING_ENDPOINT }}" `
118+
--trusted-signing-account "${{ secrets.TRUSTED_SIGNING_ACCOUNT_NAME }}" `
119+
--trusted-signing-certificate-profile "${{ secrets.TRUSTED_SIGNING_CERTIFICATE_PROFILE }}" `
120+
--file-digest SHA256 `
121+
--timestamp-rfc3161 http://timestamp.acs.microsoft.com `
122+
--timestamp-digest SHA256
121123
122124
- name: Publish packages
123-
if: success() && steps.build.outputs.publish_nuget == 'true'
125+
if: success() && steps.build.outputs.publish_nuget == 'true'
124126
working-directory: '${{ github.workspace}}\dist'
125127
run: |
126128
dotnet nuget push *.nupkg --api-key $env:NUGET_TOKEN --source https://api.nuget.org/v3/index.json
127129
env:
128130
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
129131

130132
- name: Archive NetOffice packages
131-
if: success() && steps.build.outputs.publish_nuget == 'true'
133+
if: success()
132134
uses: actions/upload-artifact@v5
133135
with:
134136
name: NetOffice_packages_v${{ steps.build.outputs.app_version_full }}

0 commit comments

Comments
 (0)