Skip to content

Commit 7f20a52

Browse files
committed
macOS release: sign and notarize package
Add step four of the macOS release process to sign and notarize the pkg and upload it as the final installer.
1 parent 42fc081 commit 7f20a52

File tree

3 files changed

+75
-257
lines changed

3 files changed

+75
-257
lines changed

.github/workflows/release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,78 @@ jobs:
163163
name: tmp.osx-pack
164164
path: |
165165
pkg
166+
167+
osx-sign:
168+
name: Sign and notarize macOS package
169+
# ESRP service requires signing to run on Windows
170+
runs-on: windows-latest
171+
needs: osx-pack
172+
steps:
173+
- name: Check out repository
174+
uses: actions/checkout@v3
175+
176+
- name: Download unsigned package
177+
uses: actions/download-artifact@v3
178+
with:
179+
name: tmp.osx-pack
180+
path: pkg
181+
182+
- name: Zip unsigned package
183+
shell: pwsh
184+
run: |
185+
Compress-Archive -Path pkg/*.pkg pkg/gcm-pkg.zip
186+
cd pkg
187+
Get-ChildItem -Exclude gcm-pkg.zip | Remove-Item -Recurse -Force
188+
189+
- uses: azure/login@v1
190+
with:
191+
creds: ${{ secrets.AZURE_CREDENTIALS }}
192+
193+
- name: Set up ESRP client
194+
shell: pwsh
195+
env:
196+
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
197+
AZURE_VAULT: ${{ secrets.AZURE_VAULT }}
198+
AUTH_CERT: ${{ secrets.AZURE_VAULT_AUTH_CERT_NAME }}
199+
REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }}
200+
run: |
201+
.github\set_up_esrp.ps1
202+
203+
- name: Sign package
204+
shell: pwsh
205+
env:
206+
AZURE_AAD_ID: ${{ secrets.AZURE_AAD_ID }}
207+
# We temporarily need two AAD IDs, as we're using an SSL certificate associated
208+
# with an older App Registration until we have the required hardware to approve
209+
# the new certificate in SSL Admin.
210+
AZURE_AAD_ID_SSL: ${{ secrets.AZURE_AAD_ID_SSL }}
211+
APPLE_KEY_CODE: ${{ secrets.APPLE_KEY_CODE }}
212+
APPLE_SIGNING_OP_CODE: ${{ secrets.APPLE_SIGNING_OPERATION_CODE }}
213+
run: |
214+
python .github\run_esrp_signing.py pkg $env:APPLE_KEY_CODE $env:APPLE_SIGNING_OP_CODE
215+
216+
- name: Unzip signed package
217+
shell: pwsh
218+
run: |
219+
mkdir unsigned
220+
Expand-Archive -LiteralPath signed\gcm-pkg.zip -DestinationPath .\unsigned -Force
221+
Remove-Item signed\gcm-pkg.zip -Force
222+
223+
- name: Notarize signed package
224+
shell: pwsh
225+
env:
226+
AZURE_AAD_ID: ${{ secrets.AZURE_AAD_ID }}
227+
# We temporarily need two AAD IDs, as we're using an SSL certificate associated
228+
# with an older App Registration until we have the required hardware to approve
229+
# the new certificate in SSL Admin.
230+
AZURE_AAD_ID_SSL: ${{ secrets.AZURE_AAD_ID_SSL }}
231+
APPLE_KEY_CODE: ${{ secrets.APPLE_KEY_CODE }}
232+
APPLE_NOTARIZATION_OP_CODE: ${{ secrets.APPLE_NOTARIZATION_OPERATION_CODE }}
233+
run: |
234+
python .github\run_esrp_signing.py unsigned $env:APPLE_KEY_CODE $env:APPLE_NOTARIZATION_OP_CODE --params 'BundleId' 'com.microsoft.gitcredentialmanager'
235+
236+
- name: Publish signed package
237+
uses: actions/upload-artifact@v3
238+
with:
239+
name: osx-sign
240+
path: signed/*.pkg

src/osx/SignFiles.Mac/SignFiles.Mac.csproj

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/osx/SignFiles.Mac/notarize-pkg.sh

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)