Skip to content

Commit 7b9afc4

Browse files
committed
automate macOS signing
1 parent 58f630e commit 7b9afc4

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

build/tfs/darwin/product-build-darwin.yml

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,58 @@ steps:
1111
set -e
1212
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
1313
yarn
14-
npm run gulp -- hygiene
15-
npm run monaco-compile-check
16-
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
14+
yarn gulp -- hygiene
15+
yarn monaco-compile-check
16+
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
1717
node build/tfs/common/installDistro.js
1818
node build/lib/builtInExtensions.js
19+
displayName: Prepare build
1920

2021
- script: |
2122
set -e
2223
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
2324
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
24-
npm run gulp -- vscode-darwin-min upload-vscode-sourcemaps
25-
name: build
25+
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps
26+
displayName: Build
2627

2728
- script: |
2829
set -e
2930
./scripts/test.sh --build --tfs "Unit Tests"
30-
APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
31+
# APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
3132
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
32-
name: test
33+
displayName: Run unit tests
3334

3435
- script: |
3536
set -e
36-
# archive the unsigned build
37-
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin-unsigned.zip * && popd
37+
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
38+
displayName: Archive build
3839

39-
# publish the unsigned build
40+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
41+
inputs:
42+
ConnectedServiceName: 'ESRP CodeSign'
43+
FolderPath: '$(agent.builddirectory)'
44+
Pattern: 'VSCode-darwin.zip'
45+
signConfigType: inlineSignParams
46+
inlineOperation: |
47+
[
48+
{
49+
"keyCode": "CP-401337-Apple",
50+
"operationSetCode": "MacAppDeveloperSign",
51+
"parameters": [ ],
52+
"toolName": "sign",
53+
"toolVersion": "1.0"
54+
}
55+
]
56+
SessionTimeout: 120
57+
displayName: Codesign
58+
59+
- script: |
60+
set -e
61+
62+
# remove pkg from archive
63+
zip -d ../VSCode-darwin.zip "*.pkg"
64+
65+
# publish the build
4066
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
4167
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
4268
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
@@ -45,19 +71,16 @@ steps:
4571
node build/tfs/common/publish.js \
4672
"$(VSCODE_QUALITY)" \
4773
darwin \
48-
archive-unsigned \
49-
"VSCode-darwin-$(VSCODE_QUALITY)-unsigned.zip" \
74+
archive \
75+
"VSCode-darwin-$(VSCODE_QUALITY).zip" \
5076
$VERSION \
51-
false \
52-
../VSCode-darwin-unsigned.zip
77+
true \
78+
../VSCode-darwin.zip
5379
5480
# publish hockeyapp symbols
5581
node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
5682
57-
# enqueue the unsigned build
58-
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
59-
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
60-
node build/tfs/darwin/enqueue.js "$(VSCODE_QUALITY)"
61-
83+
# upload configuration
6284
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
63-
npm run gulp -- upload-vscode-configuration
85+
yarn gulp -- upload-vscode-configuration
86+
displayName: Publish

0 commit comments

Comments
 (0)