mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
address pr comments
This commit is contained in:
parent
cbc174dcad
commit
18f743d534
|
@ -1,34 +0,0 @@
|
|||
parameters:
|
||||
- name: VSCODE_CLI_TARGETS
|
||||
default: []
|
||||
type: object
|
||||
- name: VSCODE_CLI_DIR
|
||||
type: string
|
||||
default: './'
|
||||
- name: VSCODE_CLI_BINARY_NAME
|
||||
type: string
|
||||
- name: channel
|
||||
type: string
|
||||
default: stable
|
||||
|
||||
steps:
|
||||
- template: ./install-rust.yml
|
||||
parameters:
|
||||
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
|
||||
channel: ${{ parameters.channel }}
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
|
||||
- script: cargo build --release --target ${{ target.target }} --bin=${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
displayName: Compile ${{ target.artifact }}
|
||||
workingDirectory: ${{ parameters.VSCODE_CLI_DIR }}
|
||||
env:
|
||||
VSCODE_CLI_VERSION: $(VSCODE_CLI_VERSION)
|
||||
VSCODE_CLI_REMOTE_LICENSE_TEXT: $(VSCODE_CLI_REMOTE_LICENSE_TEXT)
|
||||
VSCODE_CLI_REMOTE_LICENSE_PROMPT: $(VSCODE_CLI_REMOTE_LICENSE_PROMPT)
|
||||
VSCODE_CLI_ASSET_NAME: ${{ target.artifact }}
|
||||
VSCODE_CLI_AI_KEY: $(VSCODE_CLI_AI_KEY)
|
||||
VSCODE_CLI_AI_ENDPOINT: $(VSCODE_CLI_AI_ENDPOINT)
|
||||
|
||||
- publish: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
artifact: ${{ target.artifact }}
|
||||
displayName: Publish ${{ target.artifact }} artifact
|
35
build/azure-pipelines/cli/install-rust-posix.yml
Normal file
35
build/azure-pipelines/cli/install-rust-posix.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
parameters:
|
||||
- name: channel
|
||||
type: string
|
||||
default: stable
|
||||
- name: targets
|
||||
default: []
|
||||
type: object
|
||||
|
||||
# Todo: use 1ES pipeline once extension is installed in ADO
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set -e
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain $RUSTUP_TOOLCHAIN
|
||||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
|
||||
displayName: "Install Rust"
|
||||
|
||||
- bash: |
|
||||
rustup default $RUSTUP_TOOLCHAIN
|
||||
rustup update $RUSTUP_TOOLCHAIN
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
|
||||
displayName: "Set Rust version"
|
||||
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- script: rustup target add ${{ target.target }}
|
||||
displayName: "🎯 Adding '${{ target.target }}'"
|
||||
|
||||
- script: |
|
||||
rustc --version
|
||||
cargo --version
|
||||
rustup --version
|
||||
displayName: "Check Rust versions"
|
|
@ -9,15 +9,6 @@ parameters:
|
|||
# Todo: use 1ES pipeline once extension is installed in ADO
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set -e
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain $RUSTUP_TOOLCHAIN
|
||||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
|
||||
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
|
||||
displayName: "Install Rust"
|
||||
|
||||
- script: |
|
||||
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
||||
rustup-init.exe -y --profile minimal --default-toolchain %RUSTUP_TOOLCHAIN% --default-host x86_64-pc-windows-msvc
|
||||
|
@ -25,7 +16,6 @@ steps:
|
|||
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
|
||||
condition: eq(variables['Agent.OS'], 'Windows_NT')
|
||||
displayName: "Install Rust"
|
||||
|
||||
- bash: |
|
|
@ -6,35 +6,11 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const getVersion_1 = require("../../lib/getVersion");
|
||||
const fs = require("fs");
|
||||
const cp = require("child_process");
|
||||
const path = require("path");
|
||||
const packageJson = require("../../../package.json");
|
||||
const os_1 = require("os");
|
||||
const root = path.dirname(path.dirname(path.dirname(__dirname)));
|
||||
const cliPath = path.join(root, 'cli');
|
||||
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
|
||||
const commit = (0, getVersion_1.getVersion)(root);
|
||||
const getCargoLines = () => {
|
||||
const fpath = path.join(cliPath, 'Cargo.toml');
|
||||
const cargo = fs.readFileSync(fpath, 'utf-8').split(/\r?\n/g);
|
||||
return [fpath, cargo];
|
||||
};
|
||||
const addCargoDependency = (line) => {
|
||||
const [fpath, cargo] = getCargoLines();
|
||||
const depsLine = cargo.findIndex(line => line.includes('[dependencies]'));
|
||||
cargo.splice(depsLine + 1, 0, line);
|
||||
fs.writeFileSync(fpath, cargo.join('\n'));
|
||||
};
|
||||
const enableFeature = (feature) => {
|
||||
const [fpath, cargo] = getCargoLines();
|
||||
const featuresLine = cargo.findIndex(line => line.includes('[features]'));
|
||||
const prefix = 'default = ';
|
||||
const defaultFeaturesLine = cargo.findIndex((line, i) => i > featuresLine && line.startsWith(prefix));
|
||||
const defaultFeatures = new Set(JSON.parse(cargo[defaultFeaturesLine].slice(prefix.length)));
|
||||
defaultFeatures.add(feature);
|
||||
cargo[defaultFeaturesLine] = prefix + JSON.stringify([...defaultFeatures]);
|
||||
fs.writeFileSync(fpath, cargo.join('\n'));
|
||||
};
|
||||
/**
|
||||
* Sets build environment variables for the CLI for current contextual info.
|
||||
*/
|
||||
|
@ -51,26 +27,6 @@ const setLauncherEnvironmentVars = () => {
|
|||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Enables vscode-encrypt in the CLI if it's available in the current node_modules.
|
||||
* This is not graceful since Cargo doesn't have a good way to do private or
|
||||
* true-optional dependencies...
|
||||
*/
|
||||
const enableVscodeEncrypt = () => {
|
||||
const dep = packageJson.dependencies['vscode-encrypt'];
|
||||
if (!dep) {
|
||||
return;
|
||||
}
|
||||
// If there's a vscode-encrypt in the package.json, install that (alone) in
|
||||
// a temp dir for the build. This avoids having to do a full install of all
|
||||
// node modules while building the CLI.
|
||||
const stagingDir = path.join((0, os_1.tmpdir)(), `vscode-encrypt-staging-${Date.now()}`);
|
||||
fs.mkdirSync(stagingDir);
|
||||
fs.writeFileSync(path.join(stagingDir, 'package.json'), JSON.stringify({ dependencies: { 'vscode-encrypt': dep } }));
|
||||
cp.execSync('yarn', { cwd: stagingDir, stdio: 'inherit' });
|
||||
const encryptPath = path.join(stagingDir, 'node_modules', 'vscode-encrypt', 'rs-pure');
|
||||
addCargoDependency(`vscode-encrypt = { "path" = "${encryptPath.replace(/\\/g, '/')}" }`);
|
||||
enableFeature('vscode-encrypt');
|
||||
};
|
||||
setLauncherEnvironmentVars();
|
||||
enableVscodeEncrypt();
|
||||
if (require.main === module) {
|
||||
setLauncherEnvironmentVars();
|
||||
}
|
||||
|
|
|
@ -5,41 +5,13 @@
|
|||
|
||||
import { getVersion } from '../../lib/getVersion';
|
||||
import * as fs from 'fs';
|
||||
import * as cp from 'child_process';
|
||||
import * as path from 'path';
|
||||
import * as packageJson from '../../../package.json';
|
||||
import { tmpdir } from 'os';
|
||||
|
||||
const root = path.dirname(path.dirname(path.dirname(__dirname)));
|
||||
const cliPath = path.join(root, 'cli');
|
||||
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
|
||||
const commit = getVersion(root);
|
||||
|
||||
const getCargoLines = () => {
|
||||
const fpath = path.join(cliPath, 'Cargo.toml');
|
||||
const cargo = fs.readFileSync(fpath, 'utf-8').split(/\r?\n/g);
|
||||
return [fpath, cargo] as const;
|
||||
};
|
||||
|
||||
const addCargoDependency = (line: string) => {
|
||||
const [fpath, cargo] = getCargoLines();
|
||||
const depsLine = cargo.findIndex(line => line.includes('[dependencies]'));
|
||||
cargo.splice(depsLine + 1, 0, line);
|
||||
fs.writeFileSync(fpath, cargo.join('\n'));
|
||||
};
|
||||
|
||||
const enableFeature = (feature: string) => {
|
||||
const [fpath, cargo] = getCargoLines();
|
||||
const featuresLine = cargo.findIndex(line => line.includes('[features]'));
|
||||
|
||||
const prefix = 'default = ';
|
||||
const defaultFeaturesLine = cargo.findIndex((line, i) => i > featuresLine && line.startsWith(prefix));
|
||||
const defaultFeatures = new Set(JSON.parse(cargo[defaultFeaturesLine].slice(prefix.length)));
|
||||
defaultFeatures.add(feature);
|
||||
cargo[defaultFeaturesLine] = prefix + JSON.stringify([...defaultFeatures]);
|
||||
fs.writeFileSync(fpath, cargo.join('\n'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets build environment variables for the CLI for current contextual info.
|
||||
*/
|
||||
|
@ -58,29 +30,6 @@ const setLauncherEnvironmentVars = () => {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Enables vscode-encrypt in the CLI if it's available in the current node_modules.
|
||||
* This is not graceful since Cargo doesn't have a good way to do private or
|
||||
* true-optional dependencies...
|
||||
*/
|
||||
const enableVscodeEncrypt = () => {
|
||||
const dep = (packageJson.dependencies as Record<string, string>)['vscode-encrypt'];
|
||||
if (!dep) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If there's a vscode-encrypt in the package.json, install that (alone) in
|
||||
// a temp dir for the build. This avoids having to do a full install of all
|
||||
// node modules while building the CLI.
|
||||
const stagingDir = path.join(tmpdir(), `vscode-encrypt-staging-${Date.now()}`);
|
||||
fs.mkdirSync(stagingDir);
|
||||
fs.writeFileSync(path.join(stagingDir, 'package.json'), JSON.stringify({ dependencies: { 'vscode-encrypt': dep } }));
|
||||
cp.execSync('yarn', { cwd: stagingDir, stdio: 'inherit' });
|
||||
const encryptPath = path.join(stagingDir, 'node_modules', 'vscode-encrypt', 'rs-pure');
|
||||
|
||||
addCargoDependency(`vscode-encrypt = { "path" = "${encryptPath.replace(/\\/g, '/')}" }`);
|
||||
enableFeature('vscode-encrypt');
|
||||
};
|
||||
|
||||
setLauncherEnvironmentVars();
|
||||
enableVscodeEncrypt();
|
||||
if (require.main === module) {
|
||||
setLauncherEnvironmentVars();
|
||||
}
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
parameters:
|
||||
- name: VSCODE_IS_POSIX
|
||||
type: boolean
|
||||
- name: VSCODE_QUALITY
|
||||
type: string
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "16.x"
|
||||
|
||||
- ${{ if eq(parameters.VSCODE_IS_POSIX, true) }}:
|
||||
- template: ../mixin-distro-posix.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
node build/azure-pipelines/cli/prepare.js
|
||||
displayName: Prepare CLI build
|
||||
env:
|
||||
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
||||
|
||||
- ${{ if ne(parameters.VSCODE_IS_POSIX, true) }}:
|
||||
- template: ../mixin-distro-win32.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { node build/azure-pipelines/cli/prepare.js }
|
||||
displayName: Prepare CLI build
|
||||
env:
|
||||
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
|
@ -15,7 +15,6 @@ if (process.argv.length !== 8) {
|
|||
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
|
||||
process.exit(-1);
|
||||
}
|
||||
const Ignore = Symbol('Ignore');
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product, os, arch, type) {
|
||||
switch (os) {
|
||||
|
@ -45,7 +44,7 @@ function getPlatform(product, os, arch, type) {
|
|||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
case 'cli':
|
||||
return type === 'cli-unsigned' ? Ignore : `cli-win32-${arch}`;
|
||||
return `cli-win32-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
}
|
||||
|
@ -79,7 +78,7 @@ function getPlatform(product, os, arch, type) {
|
|||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
case 'cli-unsigned':
|
||||
case 'cli':
|
||||
return `cli-linux-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
|
@ -102,7 +101,7 @@ function getPlatform(product, os, arch, type) {
|
|||
}
|
||||
return `server-darwin-${arch}-web`;
|
||||
case 'cli':
|
||||
return type === 'cli-unsigned' ? Ignore : `cli-darwin-${arch}`;
|
||||
return `cli-darwin-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
}
|
||||
|
@ -142,9 +141,6 @@ async function main() {
|
|||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
if (platform === Ignore) {
|
||||
return;
|
||||
}
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION');
|
||||
|
|
|
@ -28,10 +28,8 @@ if (process.argv.length !== 8) {
|
|||
process.exit(-1);
|
||||
}
|
||||
|
||||
const Ignore = Symbol('Ignore');
|
||||
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product: string, os: string, arch: string, type: string): string | typeof Ignore {
|
||||
function getPlatform(product: string, os: string, arch: string, type: string): string {
|
||||
switch (os) {
|
||||
case 'win32':
|
||||
switch (product) {
|
||||
|
@ -59,7 +57,7 @@ function getPlatform(product: string, os: string, arch: string, type: string): s
|
|||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
case 'cli':
|
||||
return type === 'cli-unsigned' ? Ignore : `cli-win32-${arch}`;
|
||||
return `cli-win32-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
}
|
||||
|
@ -93,7 +91,7 @@ function getPlatform(product: string, os: string, arch: string, type: string): s
|
|||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
case 'cli-unsigned':
|
||||
case 'cli':
|
||||
return `cli-linux-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
|
@ -116,7 +114,7 @@ function getPlatform(product: string, os: string, arch: string, type: string): s
|
|||
}
|
||||
return `server-darwin-${arch}-web`;
|
||||
case 'cli':
|
||||
return type === 'cli-unsigned' ? Ignore : `cli-darwin-${arch}`;
|
||||
return `cli-darwin-${arch}`;
|
||||
default:
|
||||
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
|
||||
}
|
||||
|
@ -163,10 +161,6 @@ async function main(): Promise<void> {
|
|||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
if (platform === Ignore) {
|
||||
return;
|
||||
}
|
||||
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION');
|
||||
|
|
|
@ -2,9 +2,10 @@ parameters:
|
|||
- name: VSCODE_CLI_TARGETS
|
||||
default: []
|
||||
type: object
|
||||
- name: VSCODE_QUALITY
|
||||
type: string
|
||||
- name: VSCODE_CLI_DIR
|
||||
type: string
|
||||
default: './'
|
||||
- name: VSCODE_CLI_BINARY_NAME
|
||||
type: string
|
||||
- name: channel
|
||||
|
@ -12,10 +13,24 @@ parameters:
|
|||
default: stable
|
||||
|
||||
steps:
|
||||
- template: ./install-rust.yml
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "16.x"
|
||||
|
||||
- template: ../mixin-distro-posix.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
node build/azure-pipelines/cli/prepare.js
|
||||
displayName: Prepare CLI build
|
||||
env:
|
||||
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
||||
|
||||
- template: ../cli/install-rust-posix.yml
|
||||
parameters:
|
||||
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
|
||||
channel: ${{ parameters.channel }}
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
|
||||
- script: cargo build --release --target ${{ target.target }} --bin=${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
|
@ -28,13 +43,14 @@ steps:
|
|||
VSCODE_CLI_ASSET_NAME: ${{ target.artifact }}
|
||||
VSCODE_CLI_AI_KEY: $(VSCODE_CLI_AI_KEY)
|
||||
VSCODE_CLI_AI_ENDPOINT: $(VSCODE_CLI_AI_ENDPOINT)
|
||||
${{ if eq(target, 'x86_64-pc-windows-msvc') }}:
|
||||
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/deps/x64-windows-static-md/lib
|
||||
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/deps/x64-windows-static-md/include
|
||||
${{ if eq(target, 'aarch64-pc-windows-msvc') }}:
|
||||
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/deps/arm64-windows-static-md/lib
|
||||
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/deps/arm64-windows-static-md/include
|
||||
|
||||
- publish: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}.exe
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
includeRootFolder: false
|
||||
archiveType: zip
|
||||
archiveFile: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
||||
artifact: ${{ target.artifact }}
|
||||
displayName: Publish ${{ target.artifact }} artifact
|
|
@ -44,12 +44,6 @@ steps:
|
|||
artifact: ${{ target }}
|
||||
path: $(Build.ArtifactStagingDirectory)/pkg/${{ target }}
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
mkdir -p $(agent.builddirectory)/signing
|
||||
zip -j $(agent.builddirectory)/signing/${{ target }}.zip $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
displayName: Prepare ${{ target }} archive
|
||||
|
||||
- task: UseDotNet@2
|
||||
inputs:
|
||||
version: 2.x
|
||||
|
@ -59,21 +53,20 @@ steps:
|
|||
|
||||
- script: |
|
||||
set -e
|
||||
node build/azure-pipelines/common/sign "$(esrpclient.toolpath)/$(esrpclient.toolname)" darwin-sign $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(agent.builddirectory)/signing "*.zip"
|
||||
node build/azure-pipelines/common/sign "$(esrpclient.toolpath)/$(esrpclient.toolname)" darwin-sign $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(Build.ArtifactStagingDirectory)/pkg "*.zip"
|
||||
displayName: Codesign
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
node build/azure-pipelines/common/sign "$(esrpclient.toolpath)/$(esrpclient.toolname)" darwin-notarize $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(agent.builddirectory)/signing "*.zip"
|
||||
node build/azure-pipelines/common/sign "$(esrpclient.toolpath)/$(esrpclient.toolname)" darwin-notarize $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(Build.ArtifactStagingDirectory)/pkg "*.zip"
|
||||
displayName: Notarize
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_ARTIFACTS }}:
|
||||
- script: |
|
||||
ASSET_ID=$(echo "${{ target }}" | sed "s/-unsigned//")
|
||||
mkdir -p $(Build.ArtifactStagingDirectory)/final/${{ target }}
|
||||
unzip $(agent.builddirectory)/signing/${{ target }}.zip -d $(Build.ArtifactStagingDirectory)/final/${{ target }}
|
||||
ASSET_ID=$(echo "${{ target }}" | sed "s/not_yet_signed_//")
|
||||
mv $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/${{ target }}.zip $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/$ASSET_ID.zip
|
||||
echo "##vso[task.setvariable variable=ASSET_ID]$ASSET_ID"
|
||||
displayName: Set asset id variable
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/final/${{ target }}/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
- publish: $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/$(ASSET_ID).zip
|
||||
artifact: $(ASSET_ID)
|
||||
|
|
|
@ -191,11 +191,12 @@ steps:
|
|||
inputs:
|
||||
artifact: ${{ parameters.VSCODE_CLI_ARTIFACT }}
|
||||
patterns: '**'
|
||||
path: $(APP_PATH)/Contents/Resources/app/bin
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Download VS Code CLI
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
unzip "$(Build.ArtifactStagingDirectory)/${{ parameters.VSCODE_CLI_ARTIFACT }}.zip" -d "$(APP_PATH)/Contents/Resources/app/bin"
|
||||
chmod +x "$(APP_PATH)/Contents/Resources/app/bin/$(VSCODE_CLI_BINARY_NAME)"
|
||||
if [ "$(VSCODE_QUALITY)" != "stable" ]; then
|
||||
mv "$(APP_PATH)/Contents/Resources/app/bin/$(VSCODE_CLI_BINARY_NAME)" "$(APP_PATH)/Contents/Resources/app/bin/$(VSCODE_CLI_BINARY_NAME)-$(VSCODE_QUALITY)"
|
||||
|
|
|
@ -2,9 +2,10 @@ parameters:
|
|||
- name: VSCODE_CLI_TARGETS
|
||||
default: []
|
||||
type: object
|
||||
- name: VSCODE_QUALITY
|
||||
type: string
|
||||
- name: VSCODE_CLI_DIR
|
||||
type: string
|
||||
default: './'
|
||||
- name: VSCODE_CLI_BINARY_NAME
|
||||
type: string
|
||||
- name: channel
|
||||
|
@ -19,10 +20,24 @@ steps:
|
|||
sudo ln -s "/usr/bin/g++" "/usr/bin/musl-g++" || echo "link exists"
|
||||
displayName: Install build dependencies
|
||||
|
||||
- template: ./install-rust.yml
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "16.x"
|
||||
|
||||
- template: ../mixin-distro-posix.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
node build/azure-pipelines/cli/prepare.js
|
||||
displayName: Prepare CLI build
|
||||
env:
|
||||
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
||||
|
||||
- template: ../cli/install-rust-posix.yml
|
||||
parameters:
|
||||
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
|
||||
channel: ${{ parameters.channel }}
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
|
||||
- script: cargo build --release --target ${{ target.target }} --bin=${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
|
@ -38,6 +53,14 @@ steps:
|
|||
CXX_aarch64-unknown-linux-musl: musl-g++
|
||||
CC_aarch64-unknown-linux-musl: musl-gcc
|
||||
|
||||
- publish: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
includeRootFolder: false
|
||||
archiveType: tar
|
||||
tarCompression: gz
|
||||
archiveFile: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.tar.gz
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.tar.gz
|
||||
artifact: ${{ target.artifact }}
|
||||
displayName: Publish ${{ target.artifact }} artifact
|
|
@ -263,12 +263,12 @@ steps:
|
|||
inputs:
|
||||
artifact: ${{ parameters.VSCODE_CLI_ARTIFACT }}
|
||||
patterns: '**'
|
||||
path: $(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Download VS Code CLI
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
chmod +x "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin/$(VSCODE_CLI_BINARY_NAME)"
|
||||
tar -xzvf $(Build.ArtifactStagingDirectory)/${{ parameters.VSCODE_CLI_ARTIFACT }}.tar.gz -C $(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin
|
||||
if [ "$(VSCODE_QUALITY)" != "stable" ]; then
|
||||
mv "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin/$(VSCODE_CLI_BINARY_NAME)" "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)/bin/$(VSCODE_CLI_BINARY_NAME)-$(VSCODE_QUALITY)"
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
parameters:
|
||||
- name: VSCODE_QUALITY
|
||||
type: string
|
||||
|
|
|
@ -111,10 +111,6 @@ variables:
|
|||
value: ${{ parameters.VSCODE_QUALITY }}
|
||||
- name: VSCODE_BUILD_STAGE_WINDOWS
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_32BIT, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_ARM_LINUX
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE_ARM64, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_X86_LINUX
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_LINUX, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_LINUX
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_LINUX, true), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE_ARM64, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_MACOS
|
||||
|
@ -185,25 +181,22 @@ stages:
|
|||
- stage: CompileCLI
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- ${{ if eq(variables.VSCODE_BUILD_STAGE_X86_LINUX, true) }}:
|
||||
- ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE, true)) }}:
|
||||
- job: LinuxX86
|
||||
pool: vscode-1es-linux
|
||||
steps:
|
||||
- template: ./cli/prepare.yml
|
||||
- template: ./linux/cli-build-linux.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
VSCODE_IS_POSIX: true
|
||||
- template: ./cli/compile-linux.yml
|
||||
parameters:
|
||||
VSCODE_CLI_DIR: $(Build.SourcesDirectory)/cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_TARGETS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ALPINE, true) }}:
|
||||
- { target: x86_64-unknown-linux-musl, artifact: vscode_cli_alpine_x64_cli-unsigned }
|
||||
- { target: x86_64-unknown-linux-musl, artifact: vscode_cli_alpine_x64_cli }
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}:
|
||||
- { target: x86_64-unknown-linux-gnu, artifact: vscode_cli_linux_x64_cli-unsigned }
|
||||
- { target: x86_64-unknown-linux-gnu, artifact: vscode_cli_linux_x64_cli }
|
||||
|
||||
- ${{ if eq(variables.VSCODE_BUILD_STAGE_ARM_LINUX, true) }}:
|
||||
- ${{ if or(eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true), eq(parameters.VSCODE_BUILD_LINUX_ALPINE_ARM64, true)) }}:
|
||||
- job: LinuxArm64
|
||||
pool: vscode-1es-linux-20.04-arm64
|
||||
steps:
|
||||
|
@ -217,65 +210,47 @@ stages:
|
|||
sudo apt update -y
|
||||
sudo apt install -y build-essential pkg-config
|
||||
displayName: Install build dependencies
|
||||
- template: ./cli/prepare.yml
|
||||
- template: ./linux/cli-build-linux.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
VSCODE_IS_POSIX: true
|
||||
- template: ./cli/compile-linux.yml
|
||||
parameters:
|
||||
VSCODE_CLI_DIR: $(Build.SourcesDirectory)/cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_TARGETS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ALPINE_ARM64, true) }}:
|
||||
- { target: aarch64-unknown-linux-musl, artifact: vscode_cli_alpine_arm64_cli-unsigned }
|
||||
- { target: aarch64-unknown-linux-musl, artifact: vscode_cli_alpine_arm64_cli }
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}:
|
||||
- { target: aarch64-unknown-linux-gnu, artifact: vscode_cli_linux_arm64_cli-unsigned }
|
||||
- { target: aarch64-unknown-linux-gnu, artifact: vscode_cli_linux_arm64_cli }
|
||||
|
||||
- ${{ if eq(variables.VSCODE_BUILD_STAGE_MACOS, true) }}:
|
||||
- job: MacOS
|
||||
pool:
|
||||
vmImage: macOS-latest
|
||||
steps:
|
||||
- template: ./cli/prepare.yml
|
||||
- template: ./darwin/cli-build-darwin.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
VSCODE_IS_POSIX: true
|
||||
- template: ./cli/compile-macos.yml
|
||||
parameters:
|
||||
VSCODE_CLI_DIR: $(Build.SourcesDirectory)/cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_TARGETS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}:
|
||||
- { target: x86_64-apple-darwin, artifact: vscode_cli_darwin_x64_cli-unsigned }
|
||||
- { target: x86_64-apple-darwin, artifact: not_yet_signed_vscode_cli_darwin_x64_cli }
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_MACOS_ARM64, true) }}:
|
||||
- { target: aarch64-apple-darwin, artifact: vscode_cli_darwin_arm64_cli-unsigned }
|
||||
- { target: aarch64-apple-darwin, artifact: not_yet_signed_vscode_cli_darwin_arm64_cli }
|
||||
|
||||
- ${{ if eq(variables.VSCODE_BUILD_STAGE_WINDOWS, true) }}:
|
||||
- job: Windows
|
||||
pool: vscode-1es-windows
|
||||
steps:
|
||||
- template: ./cli/prepare.yml
|
||||
- template: ./win32/cli-build-win32.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
VSCODE_IS_POSIX: false
|
||||
- template: ./cli/vcpkg-deps.yml
|
||||
parameters:
|
||||
targets:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}:
|
||||
- x64-windows-static-md
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}:
|
||||
- arm64-windows-static-md
|
||||
vcpkgDir: $(Build.SourcesDirectory)/build/azure-pipelines/cli/vcpkg
|
||||
targetDirectory: $(Build.ArtifactStagingDirectory)/deps
|
||||
- template: ./cli/compile-windows.yml
|
||||
parameters:
|
||||
VSCODE_CLI_DIR: $(Build.SourcesDirectory)/cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_TARGETS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}:
|
||||
- { target: x86_64-pc-windows-msvc, artifact: vscode_cli_win32_x64_cli-unsigned }
|
||||
- { target: x86_64-pc-windows-msvc, artifact: not_yet_signed_vscode_cli_win32_x64_cli }
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}:
|
||||
- { target: aarch64-pc-windows-msvc, artifact: vscode_cli_win32_arm64_cli-unsigned }
|
||||
- { target: aarch64-pc-windows-msvc, artifact: not_yet_signed_vscode_cli_win32_arm64_cli }
|
||||
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true)) }}:
|
||||
- stage: Windows
|
||||
|
@ -340,7 +315,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
VSCODE_RUN_SMOKE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_win32_x64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: not_yet_signed_vscode_cli_win32_x64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32_32BIT, true)) }}:
|
||||
|
@ -371,7 +346,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: false
|
||||
VSCODE_RUN_SMOKE_TESTS: false
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_win32_arm64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: not_yet_signed_vscode_cli_win32_arm64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_PUBLISH'], true), eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true)) }}:
|
||||
|
@ -383,9 +358,9 @@ stages:
|
|||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_ARTIFACTS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}:
|
||||
- vscode_cli_win32_x64_cli-unsigned
|
||||
- not_yet_signed_vscode_cli_win32_x64_cli
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}:
|
||||
- vscode_cli_win32_arm64_cli-unsigned
|
||||
- not_yet_signed_vscode_cli_win32_arm64_cli
|
||||
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_LINUX'], true)) }}:
|
||||
- stage: LinuxServerDependencies
|
||||
|
@ -484,7 +459,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
VSCODE_RUN_SMOKE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_linux_x64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_linux_x64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX, true), ne(variables['VSCODE_PUBLISH'], 'false')) }}:
|
||||
|
@ -538,7 +513,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: false
|
||||
VSCODE_RUN_SMOKE_TESTS: false
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_linux_arm64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_linux_arm64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
# TODO@joaomoreno: We don't ship ARM snaps for now
|
||||
|
@ -633,7 +608,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: false
|
||||
VSCODE_RUN_SMOKE_TESTS: false
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_darwin_x64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: not_yet_signed_vscode_cli_darwin_x64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
- ${{ if eq(parameters.VSCODE_STEP_ON_IT, false) }}:
|
||||
|
@ -669,9 +644,9 @@ stages:
|
|||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
VSCODE_CLI_ARTIFACTS:
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}:
|
||||
- vscode_cli_darwin_x64_cli-unsigned
|
||||
- not_yet_signed_vscode_cli_darwin_x64_cli
|
||||
- ${{ if eq(parameters.VSCODE_BUILD_MACOS_ARM64, true) }}:
|
||||
- vscode_cli_darwin_arm64_cli-unsigned
|
||||
- not_yet_signed_vscode_cli_darwin_arm64_cli
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }}:
|
||||
- job: macOSARM64
|
||||
|
@ -687,7 +662,7 @@ stages:
|
|||
VSCODE_RUN_INTEGRATION_TESTS: false
|
||||
VSCODE_RUN_SMOKE_TESTS: false
|
||||
${{ if eq(parameters.VSCODE_BUILD_TUNNEL_CLI, true) }}:
|
||||
VSCODE_CLI_ARTIFACT: vscode_cli_darwin_arm64_cli-unsigned
|
||||
VSCODE_CLI_ARTIFACT: not_yet_signed_vscode_cli_darwin_arm64_cli
|
||||
VSCODE_CLI_BINARY_NAME: ${{ variables.VSCODE_CLI_BINARY_NAME }}
|
||||
|
||||
- ${{ if eq(variables['VSCODE_PUBLISH'], true) }}:
|
||||
|
|
|
@ -8,11 +8,14 @@ parameters:
|
|||
type: string
|
||||
|
||||
steps:
|
||||
- script: git clone https://github.com/microsoft/vcpkg.git $(Build.ArtifactStagingDirectory)/vcpkg
|
||||
displayName: Checkout vcpkg
|
||||
|
||||
- script: $(Build.ArtifactStagingDirectory)/vcpkg/bootstrap-vcpkg.bat
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
exec { git clone https://github.com/microsoft/vcpkg.git $(Build.ArtifactStagingDirectory)/vcpkg }
|
||||
exec { cd $(Build.ArtifactStagingDirectory)/vcpkg; git checkout 779ce74ef67d3e12d904da1b15f9ed5626d5f677 }
|
||||
exec { $(Build.ArtifactStagingDirectory)/vcpkg/bootstrap-vcpkg.bat }
|
||||
Write-Output "##vso[task.setvariable variable=VSCODE_DID_BOOTSTRAP_VCPKG]true"
|
||||
displayName: Bootstrap vcpkg
|
||||
condition: not(eq(variables.VSCODE_DID_BOOTSTRAP_VCPKG, true))
|
||||
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- task: Cache@2
|
73
build/azure-pipelines/win32/cli-build-win32.yml
Normal file
73
build/azure-pipelines/win32/cli-build-win32.yml
Normal file
|
@ -0,0 +1,73 @@
|
|||
parameters:
|
||||
- name: VSCODE_CLI_TARGETS
|
||||
default: []
|
||||
type: object
|
||||
- name: VSCODE_QUALITY
|
||||
type: string
|
||||
- name: VSCODE_CLI_DIR
|
||||
type: string
|
||||
- name: VSCODE_CLI_BINARY_NAME
|
||||
type: string
|
||||
- name: channel
|
||||
type: string
|
||||
default: stable
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "16.x"
|
||||
|
||||
- template: ../mixin-distro-win32.yml
|
||||
parameters:
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { node build/azure-pipelines/cli/prepare.js }
|
||||
displayName: Prepare CLI build
|
||||
env:
|
||||
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
||||
|
||||
- template: ../cli/install-rust-win32.yml
|
||||
parameters:
|
||||
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
|
||||
- template: ../vcpkg-install.yml
|
||||
parameters:
|
||||
targets:
|
||||
- ${{ if eq(target.target, 'x86_64-pc-windows-msvc') }}:
|
||||
- x64-windows-static-md
|
||||
- ${{ if eq(target.target, 'aarch64-pc-windows-msvc') }}:
|
||||
- arm64-windows-static-md
|
||||
vcpkgDir: $(Build.SourcesDirectory)/build/azure-pipelines/cli/vcpkg
|
||||
targetDirectory: $(Build.ArtifactStagingDirectory)/deps
|
||||
|
||||
- script: cargo build --release --target ${{ target.target }} --bin=${{ parameters.VSCODE_CLI_BINARY_NAME }}
|
||||
displayName: Compile ${{ target.artifact }}
|
||||
workingDirectory: ${{ parameters.VSCODE_CLI_DIR }}
|
||||
env:
|
||||
VSCODE_CLI_VERSION: $(VSCODE_CLI_VERSION)
|
||||
VSCODE_CLI_REMOTE_LICENSE_TEXT: $(VSCODE_CLI_REMOTE_LICENSE_TEXT)
|
||||
VSCODE_CLI_REMOTE_LICENSE_PROMPT: $(VSCODE_CLI_REMOTE_LICENSE_PROMPT)
|
||||
VSCODE_CLI_ASSET_NAME: ${{ target.artifact }}
|
||||
VSCODE_CLI_AI_KEY: $(VSCODE_CLI_AI_KEY)
|
||||
VSCODE_CLI_AI_ENDPOINT: $(VSCODE_CLI_AI_ENDPOINT)
|
||||
${{ if eq(target, 'x86_64-pc-windows-msvc') }}:
|
||||
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/deps/x64-windows-static-md/lib
|
||||
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/deps/x64-windows-static-md/include
|
||||
${{ if eq(target, 'aarch64-pc-windows-msvc') }}:
|
||||
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/deps/arm64-windows-static-md/lib
|
||||
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/deps/arm64-windows-static-md/include
|
||||
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: ${{ parameters.VSCODE_CLI_DIR }}/target/${{ target.target }}/release/${{ parameters.VSCODE_CLI_BINARY_NAME }}.exe
|
||||
includeRootFolder: false
|
||||
archiveType: zip
|
||||
archiveFile: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
||||
artifact: ${{ target.artifact }}
|
||||
displayName: Publish ${{ target.artifact }} artifact
|
|
@ -31,6 +31,11 @@ steps:
|
|||
artifact: ${{ target }}
|
||||
path: $(Build.ArtifactStagingDirectory)/pkg/${{ target }}
|
||||
|
||||
- task: ExtractFiles@1
|
||||
inputs:
|
||||
archiveFilePatterns: $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/*.zip
|
||||
destinationFolder: $(Build.ArtifactStagingDirectory)/sign/${{ target }}
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: "Use .NET"
|
||||
inputs:
|
||||
|
@ -53,14 +58,21 @@ steps:
|
|||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { node build\azure-pipelines\common\sign $env:EsrpCliDllPath windows $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(Build.ArtifactStagingDirectory)/pkg "*.exe" }
|
||||
exec { node build\azure-pipelines\common\sign $env:EsrpCliDllPath windows $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(Build.ArtifactStagingDirectory)/sign "*.exe" }
|
||||
displayName: "Code sign"
|
||||
|
||||
- ${{ each target in parameters.VSCODE_CLI_ARTIFACTS }}:
|
||||
- powershell: |
|
||||
$ASSET_ID = "${{ target }}".replace("-unsigned", "");
|
||||
$ASSET_ID = "${{ target }}".replace("not_yet_signed_", "");
|
||||
echo "##vso[task.setvariable variable=ASSET_ID]$ASSET_ID"
|
||||
displayName: Set asset id variable
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/pkg/${{ target }}/${{ parameters.VSCODE_CLI_BINARY_NAME }}.exe
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: $(Build.ArtifactStagingDirectory)/sign/${{ target }}/${{ parameters.VSCODE_CLI_BINARY_NAME }}.exe
|
||||
includeRootFolder: false
|
||||
archiveType: zip
|
||||
archiveFile: $(Build.ArtifactStagingDirectory)/$(ASSET_ID).zip
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/$(ASSET_ID).zip
|
||||
artifact: $(ASSET_ID)
|
||||
|
|
|
@ -186,14 +186,19 @@ steps:
|
|||
inputs:
|
||||
artifact: ${{ parameters.VSCODE_CLI_ARTIFACT }}
|
||||
patterns: '**'
|
||||
path: $(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)/bin
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Download VS Code CLI
|
||||
|
||||
- ${{ if ne(parameters.VSCODE_QUALITY, 'stable') }}:
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
Expand-Archive -Path "$(Build.ArtifactStagingDirectory)/${{ parameters.VSCODE_CLI_ARTIFACT }}.zip" -DestinationPath "$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)/bin"
|
||||
|
||||
if ("$(VSCODE_QUALITY)" -ne "stable")
|
||||
{
|
||||
Move-Item -Path "$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)/bin/$(VSCODE_CLI_BINARY_NAME).exe" -Destination "$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)/bin/$(VSCODE_CLI_BINARY_NAME)-$(VSCODE_QUALITY).exe"
|
||||
displayName: Move VS Code CLI
|
||||
}
|
||||
|
||||
displayName: Move VS Code CLI
|
||||
|
||||
- ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
|
||||
- powershell: |
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const optimize = require('./lib/optimize');
|
||||
const es = require('event-stream');
|
||||
|
@ -18,7 +19,7 @@ const monacoapi = require('./lib/monaco-api');
|
|||
const fs = require('fs');
|
||||
|
||||
const root = path.dirname(__dirname);
|
||||
const sha1 = util.getVersion(root);
|
||||
const sha1 = getVersion(root);
|
||||
const semver = require('./monaco/package.json').version;
|
||||
const headerVersion = semver + '(' + sha1 + ')';
|
||||
|
||||
|
|
|
@ -12,12 +12,13 @@ const nodeUtil = require('util');
|
|||
const es = require('event-stream');
|
||||
const filter = require('gulp-filter');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const watcher = require('./lib/watch');
|
||||
const createReporter = require('./lib/reporter').createReporter;
|
||||
const glob = require('glob');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const commit = getVersion(root);
|
||||
const plumber = require('gulp-plumber');
|
||||
const ext = require('./lib/extensions');
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ const gulp = require('gulp');
|
|||
const path = require('path');
|
||||
const es = require('event-stream');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const optimize = require('./lib/optimize');
|
||||
const product = require('../product.json');
|
||||
|
@ -30,7 +31,7 @@ const { vscodeWebEntryPoints, vscodeWebResourceIncludes, createVSCodeWebFileCont
|
|||
const cp = require('child_process');
|
||||
|
||||
const REPO_ROOT = path.dirname(__dirname);
|
||||
const commit = util.getVersion(REPO_ROOT);
|
||||
const commit = getVersion(REPO_ROOT);
|
||||
const BUILD_ROOT = path.dirname(REPO_ROOT);
|
||||
const REMOTE_FOLDER = path.join(REPO_ROOT, 'remote');
|
||||
|
||||
|
|
|
@ -18,11 +18,12 @@ const replace = require('gulp-replace');
|
|||
const filter = require('gulp-filter');
|
||||
const _ = require('underscore');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const buildfile = require('../src/buildfile');
|
||||
const optimize = require('./lib/optimize');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const commit = getVersion(root);
|
||||
const packageJson = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const crypto = require('crypto');
|
||||
|
|
|
@ -12,6 +12,7 @@ const shell = require('gulp-shell');
|
|||
const es = require('event-stream');
|
||||
const vfs = require('vinyl-fs');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const packageJson = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
|
@ -20,7 +21,7 @@ const sysrootInstaller = require('./linux/debian/install-sysroot');
|
|||
const debianRecommendedDependencies = require('./linux/debian/dep-lists').recommendedDeps;
|
||||
const path = require('path');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const commit = getVersion(root);
|
||||
|
||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ const gulp = require('gulp');
|
|||
const path = require('path');
|
||||
const es = require('event-stream');
|
||||
const util = require('./lib/util');
|
||||
const { getVersion } = require('./lib/getVersion');
|
||||
const task = require('./lib/task');
|
||||
const optimize = require('./lib/optimize');
|
||||
const product = require('../product.json');
|
||||
|
@ -26,7 +27,7 @@ const REPO_ROOT = path.dirname(__dirname);
|
|||
const BUILD_ROOT = path.dirname(REPO_ROOT);
|
||||
const WEB_FOLDER = path.join(REPO_ROOT, 'remote', 'web');
|
||||
|
||||
const commit = util.getVersion(REPO_ROOT);
|
||||
const commit = getVersion(REPO_ROOT);
|
||||
const quality = product.quality;
|
||||
const version = (quality && quality !== 'stable') ? `${packageJson.version}-${quality}` : packageJson.version;
|
||||
|
||||
|
|
|
@ -11,12 +11,13 @@ const vfs = require("vinyl-fs");
|
|||
const filter = require("gulp-filter");
|
||||
const _ = require("underscore");
|
||||
const util = require("./util");
|
||||
const getVersion_1 = require("./getVersion");
|
||||
function isDocumentSuffix(str) {
|
||||
return str === 'document' || str === 'script' || str === 'file' || str === 'source code';
|
||||
}
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
|
||||
const commit = util.getVersion(root);
|
||||
const commit = (0, getVersion_1.getVersion)(root);
|
||||
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
||||
/**
|
||||
* Generate a `DarwinDocumentType` given a list of file extensions, an icon name, and an optional suffix or file type name.
|
||||
|
|
|
@ -9,6 +9,7 @@ import * as vfs from 'vinyl-fs';
|
|||
import * as filter from 'gulp-filter';
|
||||
import * as _ from 'underscore';
|
||||
import * as util from './util';
|
||||
import { getVersion } from './getVersion';
|
||||
|
||||
type DarwinDocumentSuffix = 'document' | 'script' | 'file' | 'source code';
|
||||
type DarwinDocumentType = {
|
||||
|
@ -26,7 +27,7 @@ function isDocumentSuffix(str?: string): str is DarwinDocumentSuffix {
|
|||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
|
||||
const commit = util.getVersion(root);
|
||||
const commit = getVersion(root);
|
||||
|
||||
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ const jsoncParser = require("jsonc-parser");
|
|||
const dependencies_1 = require("./dependencies");
|
||||
const _ = require("underscore");
|
||||
const builtInExtensions_1 = require("./builtInExtensions");
|
||||
const util = require('./util');
|
||||
const getVersion_1 = require("./getVersion");
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const commit = util.getVersion(root);
|
||||
const commit = (0, getVersion_1.getVersion)(root);
|
||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
function minifyExtensionResources(input) {
|
||||
const jsonFilter = filter(['**/*.json', '**/*.code-snippets'], { restore: true });
|
||||
|
|
|
@ -26,9 +26,10 @@ import webpack = require('webpack');
|
|||
import { getProductionDependencies } from './dependencies';
|
||||
import _ = require('underscore');
|
||||
import { getExtensionStream } from './builtInExtensions';
|
||||
const util = require('./util');
|
||||
import { getVersion } from './getVersion';
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const commit = util.getVersion(root);
|
||||
const commit = getVersion(root);
|
||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
|
||||
function minifyExtensionResources(input: Stream): Stream {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.buildWebNodePaths = exports.createExternalLoaderConfig = exports.acquireWebNodePaths = exports.getElectronVersion = exports.streamToPromise = exports.versionStringToNumber = exports.filter = exports.rebase = exports.ensureDir = exports.rreddir = exports.rimraf = exports.rewriteSourceMappingURL = exports.stripSourceMappingURL = exports.loadSourcemaps = exports.cleanNodeModules = exports.skipDirectories = exports.toFileUri = exports.setExecutableBit = exports.fixWin32DirectoryPermissions = exports.debounce = exports.incremental = exports.getVersion = void 0;
|
||||
exports.buildWebNodePaths = exports.createExternalLoaderConfig = exports.acquireWebNodePaths = exports.getElectronVersion = exports.streamToPromise = exports.versionStringToNumber = exports.filter = exports.rebase = exports.ensureDir = exports.rreddir = exports.rimraf = exports.rewriteSourceMappingURL = exports.stripSourceMappingURL = exports.loadSourcemaps = exports.cleanNodeModules = exports.skipDirectories = exports.toFileUri = exports.setExecutableBit = exports.fixWin32DirectoryPermissions = exports.debounce = exports.incremental = void 0;
|
||||
const es = require("event-stream");
|
||||
const _debounce = require("debounce");
|
||||
const _filter = require("gulp-filter");
|
||||
|
@ -13,8 +13,6 @@ const path = require("path");
|
|||
const fs = require("fs");
|
||||
const _rimraf = require("rimraf");
|
||||
const VinylFile = require("vinyl");
|
||||
var getVersion_1 = require("./getVersion");
|
||||
Object.defineProperty(exports, "getVersion", { enumerable: true, get: function () { return getVersion_1.getVersion; } });
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const NoCancellationToken = { isCancellationRequested: () => false };
|
||||
function incremental(streamProvider, initial, supportsCancellation) {
|
||||
|
|
|
@ -15,8 +15,6 @@ import * as VinylFile from 'vinyl';
|
|||
import { ThroughStream } from 'through';
|
||||
import * as sm from 'source-map';
|
||||
|
||||
export { getVersion } from './getVersion';
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
|
||||
export interface ICancellationToken {
|
||||
|
|
Loading…
Reference in a new issue