Skip to content

Commit 093353c

Browse files
Merge pull request #2 from microsoft/main
Updating Fork
2 parents 969cf18 + fe23c20 commit 093353c

File tree

93 files changed

+1041
-486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1041
-486
lines changed

.vscode/tasks.json

+2-42
Original file line numberDiff line numberDiff line change
@@ -55,39 +55,11 @@
5555
}
5656
}
5757
},
58-
{
59-
"type": "npm",
60-
"script": "watch-extension-mediad",
61-
"label": "Ext Media - Build",
62-
"isBackground": true,
63-
"presentation": {
64-
"reveal": "never",
65-
"group": "buildWatchers"
66-
},
67-
"problemMatcher": {
68-
"owner": "typescript",
69-
"applyTo": "closedDocuments",
70-
"fileLocation": [
71-
"absolute"
72-
],
73-
"pattern": {
74-
"regexp": "Error: ([^(]+)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\): (.*)$",
75-
"file": 1,
76-
"location": 2,
77-
"message": 3
78-
},
79-
"background": {
80-
"beginsPattern": "Starting compilation",
81-
"endsPattern": "Finished compilation"
82-
}
83-
}
84-
},
8558
{
8659
"label": "VS Code - Build",
8760
"dependsOn": [
8861
"Core - Build",
89-
"Ext - Build",
90-
"Ext Media - Build",
62+
"Ext - Build"
9163
],
9264
"group": {
9365
"kind": "build",
@@ -117,23 +89,11 @@
11789
},
11890
"problemMatcher": "$tsc"
11991
},
120-
{
121-
"type": "npm",
122-
"script": "kill-watch-extension-mediad",
123-
"label": "Kill Ext Media - Build",
124-
"group": "build",
125-
"presentation": {
126-
"reveal": "never",
127-
"group": "buildKillers"
128-
},
129-
"problemMatcher": "$tsc"
130-
},
13192
{
13293
"label": "Kill VS Code - Build",
13394
"dependsOn": [
13495
"Kill Core - Build",
135-
"Kill Ext - Build",
136-
"Kill Ext Media - Build",
96+
"Kill Ext - Build"
13797
],
13898
"group": "build",
13999
"problemMatcher": []

build/azure-pipelines/common/createAsset.js

+92-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,95 @@ const azure = require("azure-storage");
1010
const mime = require("mime");
1111
const cosmos_1 = require("@azure/cosmos");
1212
const retry_1 = require("./retry");
13-
if (process.argv.length !== 6) {
14-
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
13+
if (process.argv.length !== 8) {
14+
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
1515
process.exit(-1);
1616
}
17+
// Contains all of the logic for mapping details to our actual product names in CosmosDB
18+
function getPlatform(product, os, arch, type) {
19+
switch (os) {
20+
case 'win32':
21+
switch (product) {
22+
case 'client':
23+
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
24+
switch (type) {
25+
case 'archive':
26+
return `${asset}-archive`;
27+
case 'setup':
28+
return asset;
29+
case 'user-setup':
30+
return `${asset}-user`;
31+
default:
32+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
33+
}
34+
case 'server':
35+
if (arch === 'arm64') {
36+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
37+
}
38+
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
39+
case 'web':
40+
if (arch === 'arm64') {
41+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
42+
}
43+
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
44+
default:
45+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
46+
}
47+
case 'linux':
48+
switch (type) {
49+
case 'snap':
50+
return `linux-snap-${arch}`;
51+
case 'archive-unsigned':
52+
switch (product) {
53+
case 'client':
54+
return `linux-${arch}`;
55+
case 'server':
56+
return `server-linux-${arch}`;
57+
case 'web':
58+
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
59+
default:
60+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
61+
}
62+
case 'deb-package':
63+
return `linux-deb-${arch}`;
64+
case 'rpm-package':
65+
return `linux-rpm-${arch}`;
66+
default:
67+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
68+
}
69+
case 'darwin':
70+
switch (product) {
71+
case 'client':
72+
if (arch === 'x64') {
73+
return 'darwin';
74+
}
75+
return `darwin-${arch}`;
76+
case 'server':
77+
return 'server-darwin';
78+
case 'web':
79+
if (arch !== 'x64') {
80+
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
81+
}
82+
return 'server-darwin-web';
83+
default:
84+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
85+
}
86+
default:
87+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
88+
}
89+
}
90+
// Contains all of the logic for mapping types to our actual types in CosmosDB
91+
function getRealType(type) {
92+
switch (type) {
93+
case 'user-setup':
94+
return 'setup';
95+
case 'deb-package':
96+
case 'rpm-package':
97+
return 'package';
98+
default:
99+
return type;
100+
}
101+
}
17102
function hashStream(hashName, stream) {
18103
return new Promise((c, e) => {
19104
const shasum = crypto.createHash(hashName);
@@ -45,7 +130,10 @@ function getEnv(name) {
45130
return result;
46131
}
47132
async function main() {
48-
const [, , platform, type, fileName, filePath] = process.argv;
133+
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
134+
// getPlatform needs the unprocessedType
135+
const platform = getPlatform(product, os, arch, unprocessedType);
136+
const type = getRealType(unprocessedType);
49137
const quality = getEnv('VSCODE_QUALITY');
50138
const commit = getEnv('BUILD_SOURCEVERSION');
51139
console.log('Creating asset...');
@@ -83,7 +171,7 @@ async function main() {
83171
console.log('Asset:', JSON.stringify(asset, null, ' '));
84172
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
85173
const scripts = client.database('builds').container(quality).scripts;
86-
await retry_1.retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
174+
await (0, retry_1.retry)(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
87175
}
88176
main().then(() => {
89177
console.log('Asset successfully created');

build/azure-pipelines/common/createAsset.ts

+93-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,98 @@ interface Asset {
2424
supportsFastUpdate?: boolean;
2525
}
2626

27-
if (process.argv.length !== 6) {
28-
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
27+
if (process.argv.length !== 8) {
28+
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
2929
process.exit(-1);
3030
}
3131

32+
// Contains all of the logic for mapping details to our actual product names in CosmosDB
33+
function getPlatform(product: string, os: string, arch: string, type: string): string {
34+
switch (os) {
35+
case 'win32':
36+
switch (product) {
37+
case 'client':
38+
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
39+
switch (type) {
40+
case 'archive':
41+
return `${asset}-archive`;
42+
case 'setup':
43+
return asset;
44+
case 'user-setup':
45+
return `${asset}-user`;
46+
default:
47+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
48+
}
49+
case 'server':
50+
if (arch === 'arm64') {
51+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
52+
}
53+
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
54+
case 'web':
55+
if (arch === 'arm64') {
56+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
57+
}
58+
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
59+
default:
60+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
61+
}
62+
case 'linux':
63+
switch (type) {
64+
case 'snap':
65+
return `linux-snap-${arch}`;
66+
case 'archive-unsigned':
67+
switch (product) {
68+
case 'client':
69+
return `linux-${arch}`;
70+
case 'server':
71+
return `server-linux-${arch}`;
72+
case 'web':
73+
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
74+
default:
75+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
76+
}
77+
case 'deb-package':
78+
return `linux-deb-${arch}`;
79+
case 'rpm-package':
80+
return `linux-rpm-${arch}`;
81+
default:
82+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
83+
}
84+
case 'darwin':
85+
switch (product) {
86+
case 'client':
87+
if (arch === 'x64') {
88+
return 'darwin';
89+
}
90+
return `darwin-${arch}`;
91+
case 'server':
92+
return 'server-darwin';
93+
case 'web':
94+
if (arch !== 'x64') {
95+
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
96+
}
97+
return 'server-darwin-web';
98+
default:
99+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
100+
}
101+
default:
102+
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
103+
}
104+
}
105+
106+
// Contains all of the logic for mapping types to our actual types in CosmosDB
107+
function getRealType(type: string) {
108+
switch (type) {
109+
case 'user-setup':
110+
return 'setup';
111+
case 'deb-package':
112+
case 'rpm-package':
113+
return 'package';
114+
default:
115+
return type;
116+
}
117+
}
118+
32119
function hashStream(hashName: string, stream: Readable): Promise<string> {
33120
return new Promise<string>((c, e) => {
34121
const shasum = crypto.createHash(hashName);
@@ -68,7 +155,10 @@ function getEnv(name: string): string {
68155
}
69156

70157
async function main(): Promise<void> {
71-
const [, , platform, type, fileName, filePath] = process.argv;
158+
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
159+
// getPlatform needs the unprocessedType
160+
const platform = getPlatform(product, os, arch, unprocessedType);
161+
const type = getRealType(unprocessedType);
72162
const quality = getEnv('VSCODE_QUALITY');
73163
const commit = getEnv('BUILD_SOURCEVERSION');
74164

build/azure-pipelines/darwin/product-build-darwin-sign.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ steps:
3535
displayName: Restore modules for just build folder and compile it
3636
3737
- download: current
38-
artifact: vscode-darwin-$(VSCODE_ARCH)
38+
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
3939
displayName: Download $(VSCODE_ARCH) artifact
4040

4141
- script: |
4242
set -e
43-
unzip $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
44-
mv $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
43+
unzip $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
44+
mv $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
4545
displayName: Unzip & move
4646
4747
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
@@ -108,22 +108,18 @@ steps:
108108
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))
109109
110110
- script: |
111-
set -e
112-
113111
# For legacy purposes, arch for x64 is just 'darwin'
114112
case $VSCODE_ARCH in
115113
x64) ASSET_ID="darwin" ;;
116114
arm64) ASSET_ID="darwin-arm64" ;;
117115
universal) ASSET_ID="darwin-universal" ;;
118116
esac
117+
echo "##vso[task.setvariable variable=ASSET_ID]$ASSET_ID"
118+
displayName: Set asset id variable
119+
120+
- script: mv $(agent.builddirectory)/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin.zip
121+
displayName: Rename x64 build to it's legacy name
122+
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
119123

120-
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
121-
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
122-
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
123-
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
124-
node build/azure-pipelines/common/createAsset.js \
125-
"$ASSET_ID" \
126-
archive \
127-
"VSCode-$ASSET_ID.zip" \
128-
../VSCode-darwin-$(VSCODE_ARCH).zip
129-
displayName: Publish Clients
124+
- publish: $(Agent.BuildDirectory)/VSCode-$(ASSET_ID).zip
125+
artifact: vscode_client_darwin_$(VSCODE_ARCH)_archive

0 commit comments

Comments
 (0)