@@ -139,12 +139,13 @@ jobs:
139
139
./payload/*
140
140
141
141
# ================================
142
- # Windows
142
+ # Windows
143
143
# ================================
144
- win-sign :
145
- name : Build and Sign Windows
144
+ create-windows-artifacts :
145
+ name : Create Windows Artifacts
146
146
runs-on : windows-latest
147
147
environment : release
148
+ needs : prereqs
148
149
steps :
149
150
- uses : actions/checkout@v4
150
151
@@ -153,9 +154,6 @@ jobs:
153
154
with :
154
155
dotnet-version : 7.0.x
155
156
156
- - name : Install dependencies
157
- run : dotnet restore
158
-
159
157
- name : Build
160
158
run : |
161
159
dotnet build --configuration=WindowsRelease
@@ -165,80 +163,66 @@ jobs:
165
163
dotnet test --configuration=WindowsRelease
166
164
167
165
- name : Lay out Windows payload and symbols
168
- shell : pwsh
169
166
run : |
170
- cd src/ windows/ Installer.Windows/
171
- ./layout.ps1 -Configuration WindowsRelease -Output payload -SymbolOutput symbols
172
- mkdir unsigned- payload
173
- Get-ChildItem -Path payload/* -Include *.exe, *.dll | Move-Item -Destination unsigned-payload
167
+ cd $env:GITHUB_WORKSPACE\ src\ windows\ Installer.Windows\
168
+ ./layout.ps1 -Configuration WindowsRelease `
169
+ -Output $env:GITHUB_WORKSPACE\ payload `
170
+ -SymbolOutput $env:GITHUB_WORKSPACE\symbols
174
171
175
- - uses : azure/login@v1
172
+ - name : Log into Azure
173
+ uses : azure/login@v1
176
174
with :
177
- creds : ${{ secrets.AZURE_CREDENTIALS }}
178
-
179
- - name : Set up ESRP client
180
- shell : pwsh
181
- env :
182
- AZURE_VAULT : ${{ secrets.AZURE_VAULT }}
183
- AUTH_CERT : ${{ secrets.AZURE_VAULT_AUTH_CERT_NAME }}
184
- REQUEST_SIGNING_CERT : ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }}
185
- run : |
186
- .github\set_up_esrp.ps1
175
+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
176
+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
177
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
187
178
188
- - name : Run ESRP client for unsigned payload
189
- shell : pwsh
190
- env :
191
- AZURE_AAD_ID : ${{ secrets.AZURE_AAD_ID }}
192
- WINDOWS_KEY_CODE : ${{ secrets.WINDOWS_KEY_CODE }}
193
- WINDOWS_OP_CODE : ${{ secrets.WINDOWS_OPERATION_CODE }}
194
- run : |
195
- python .github\run_esrp_signing.py `
196
- src/windows/Installer.Windows/unsigned-payload `
197
- $env:WINDOWS_KEY_CODE $env:WINDOWS_OP_CODE `
198
- --params 'OpusName' 'Microsoft' `
199
- 'OpusInfo' 'http://www.microsoft.com' `
200
- 'FileDigest' '/fd "SHA256"' 'PageHash' '/NPH' `
201
- 'TimeStamp' '/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256'
202
-
203
- - name : Lay out signed payload
204
- shell : pwsh
205
- run : |
206
- mkdir signed-payload
207
- Move-Item -Path signed/* -Destination signed-payload
208
- # ESRP will not sign the *.exe.config or NOTICE files, but they are needed to build the installers.
209
- # Due to this, we copy them after signing.
210
- Get-ChildItem -Path src/windows/Installer.Windows/payload/* -Include *.exe.config, NOTICE | Move-Item -Destination signed-payload
211
- Remove-Item signed -Recurse -Force
179
+ - name : Sign payload files with Azure Code Signing
180
+
181
+ with :
182
+ endpoint : https://wus2.codesigning.azure.net/
183
+ code-signing-account-name : git-fundamentals-signing
184
+ certificate-profile-name : git-fundamentals-windows-signing
185
+ files-folder : ${{ github.workspace }}\payload
186
+ files-folder-filter : exe,dll
187
+ file-digest : SHA256
188
+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
189
+ timestamp-digest : SHA256
190
+
191
+ # The Azure Code Signing action overrides the .NET version, so we reset it.
192
+ - name : Set up .NET
193
+
194
+ with :
195
+ dotnet-version : 7.0.x
212
196
213
197
- name : Build with signed payload
214
- shell : pwsh
215
198
run : |
216
- dotnet build src/windows/Installer.Windows /p:PayloadPath=$env:GITHUB_WORKSPACE/signed-payload /p:NoLayout=true --configuration=WindowsRelease
199
+ dotnet build $env:GITHUB_WORKSPACE\src\windows\Installer.Windows `
200
+ /p:PayloadPath=$env:GITHUB_WORKSPACE\payload /p:NoLayout=true `
201
+ --configuration=WindowsRelease
202
+ mkdir installers
203
+ Move-Item -Path .\out\windows\Installer.Windows\bin\Release\net472\*.exe `
204
+ -Destination $env:GITHUB_WORKSPACE\installers
205
+
206
+ - name : Sign installers with Azure Code Signing
207
+
208
+ with :
209
+ endpoint : https://wus2.codesigning.azure.net/
210
+ code-signing-account-name : git-fundamentals-signing
211
+ certificate-profile-name : git-fundamentals-windows-signing
212
+ files-folder : ${{ github.workspace }}\installers
213
+ files-folder-filter : exe
214
+ file-digest : SHA256
215
+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
216
+ timestamp-digest : SHA256
217
217
218
- - name : Run ESRP client for installers
219
- shell : pwsh
220
- env :
221
- AZURE_AAD_ID : ${{ secrets.AZURE_AAD_ID }}
222
- WINDOWS_KEY_CODE : ${{ secrets.WINDOWS_KEY_CODE }}
223
- WINDOWS_OP_CODE : ${{ secrets.WINDOWS_OPERATION_CODE }}
224
- run : |
225
- python .github\run_esrp_signing.py `
226
- .\out\windows\Installer.Windows\bin\WindowsRelease\net472 `
227
- $env:WINDOWS_KEY_CODE `
228
- $env:WINDOWS_OP_CODE `
229
- --params 'OpusName' 'Microsoft' `
230
- 'OpusInfo' 'http://www.microsoft.com' `
231
- 'FileDigest' '/fd "SHA256"' 'PageHash' '/NPH' `
232
- 'TimeStamp' '/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256'
233
-
234
- - name : Publish final artifacts
218
+ - name : Upload artifacts
235
219
uses : actions/upload-artifact@v3
236
220
with :
237
- name : win-sign
221
+ name : windows-artifacts
238
222
path : |
239
- signed
240
- signed-payload
241
- src/windows/Installer.Windows/ symbols
223
+ payload
224
+ installers
225
+ symbols
242
226
243
227
# ================================
244
228
# Linux
@@ -511,7 +495,7 @@ jobs:
511
495
command : git-credential-manager
512
496
description : osx-x64
513
497
- os : windows-latest
514
- artifact : win-sign
498
+ artifact : windows-artifacts
515
499
# Even when a standalone GCM version is installed, GitHub actions
516
500
# runners still only recognize the version bundled with Git for
517
501
# Windows due to its placement on the PATH. For this reason, we use
@@ -523,10 +507,15 @@ jobs:
523
507
command : git-credential-manager
524
508
description : dotnet-tool
525
509
runs-on : ${{ matrix.component.os }}
526
- needs : [ create-macos-artifacts, win-sign , create-linux-artifacts, dotnet-tool-sign ]
510
+ needs : [ create-macos-artifacts, create-windows-artifacts , create-linux-artifacts, dotnet-tool-sign ]
527
511
steps :
528
512
- uses : actions/checkout@v4
529
513
514
+ - name : Set up .NET
515
+
516
+ with :
517
+ dotnet-version : 7.0.x
518
+
530
519
- name : Download artifacts
531
520
uses : actions/download-artifact@v3
532
521
with :
@@ -536,7 +525,7 @@ jobs:
536
525
if : contains(matrix.component.description, 'windows')
537
526
shell : pwsh
538
527
run : |
539
- $exePaths = Get-ChildItem -Path ./signed /*.exe | %{$_.FullName}
528
+ $exePaths = Get-ChildItem -Path ./installers /*.exe | %{$_.FullName}
540
529
foreach ($exePath in $exePaths)
541
530
{
542
531
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART"
@@ -610,9 +599,10 @@ jobs:
610
599
611
600
- name : Archive Windows payload and symbols
612
601
run : |
602
+ version="${{ needs.prereqs.outputs.version }}"
613
603
mkdir win-x86-payload-and-symbols
614
- zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION .zip win-sign/signed- payload
615
- zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION -symbols.zip win-sign/src/ windows/Installer.Windows /symbols
604
+ zip -jr win-x86-payload-and-symbols/gcm-win-x86-$version .zip windows-artifacts/ payload
605
+ zip -jr win-x86-payload-and-symbols/gcm-win-x86-$version -symbols.zip windows-artifacts /symbols
616
606
617
607
- uses : actions/github-script@v6
618
608
with :
@@ -660,7 +650,7 @@ jobs:
660
650
661
651
await Promise.all([
662
652
// Upload Windows artifacts
663
- uploadDirectoryToRelease('win-sign/signed '),
653
+ uploadDirectoryToRelease('windows-artifacts/installers '),
664
654
uploadDirectoryToRelease('win-x86-payload-and-symbols'),
665
655
666
656
// Upload macOS artifacts
0 commit comments