2022-09-20 07:40:39 +08:00
|
|
|
parameters:
|
2022-10-11 01:16:02 +08:00
|
|
|
- name: VSCODE_BUILD_WIN32
|
|
|
|
type: boolean
|
|
|
|
- name: VSCODE_BUILD_WIN32_ARM64
|
|
|
|
type: boolean
|
2022-10-06 01:05:40 +08:00
|
|
|
- name: VSCODE_QUALITY
|
|
|
|
type: string
|
2022-09-20 07:40:39 +08:00
|
|
|
- name: channel
|
|
|
|
type: string
|
|
|
|
default: stable
|
|
|
|
|
2022-10-11 01:16:02 +08:00
|
|
|
variables:
|
|
|
|
- name: VSCODE_CLI_TARGETS
|
|
|
|
value:
|
|
|
|
- ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}:
|
|
|
|
- { target: x86_64-pc-windows-msvc, artifact: unsigned_vscode_cli_win32_x64_cli }
|
|
|
|
- ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}:
|
|
|
|
- { target: aarch64-pc-windows-msvc, artifact: unsigned_vscode_cli_win32_arm64_cli }
|
|
|
|
|
2022-09-20 07:40:39 +08:00
|
|
|
steps:
|
2022-10-06 01:05:40 +08:00
|
|
|
- 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
|
2022-09-20 07:40:39 +08:00
|
|
|
parameters:
|
2022-09-21 00:15:01 +08:00
|
|
|
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
|
2022-09-20 07:40:39 +08:00
|
|
|
|
2022-10-11 01:16:02 +08:00
|
|
|
- template: ../vcpkg-install.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
|
2022-10-06 01:05:40 +08:00
|
|
|
|
2022-10-11 01:16:02 +08:00
|
|
|
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
|
|
|
|
- script: cargo build --release --target ${{ target.target }} --bin=code-tunnel
|
2022-09-21 00:15:01 +08:00
|
|
|
displayName: Compile ${{ target.artifact }}
|
2022-10-11 01:16:02 +08:00
|
|
|
workingDirectory: $(Build.SourcesDirectory)/cli
|
2022-09-20 07:40:39 +08:00
|
|
|
env:
|
2022-09-21 00:15:01 +08:00
|
|
|
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)
|
2022-09-20 07:40:39 +08:00
|
|
|
${{ 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
|
|
|
|
|
2022-10-06 01:05:40 +08:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
inputs:
|
2022-10-11 01:16:02 +08:00
|
|
|
rootFolderOrFile: $(Build.SourcesDirectory)/cli/target/${{ target.target }}/release/code-tunnel.exe
|
2022-10-06 01:05:40 +08:00
|
|
|
includeRootFolder: false
|
|
|
|
archiveType: zip
|
|
|
|
archiveFile: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
|
|
|
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)/${{ target.artifact }}.zip
|
2022-09-21 00:15:01 +08:00
|
|
|
artifact: ${{ target.artifact }}
|
|
|
|
displayName: Publish ${{ target.artifact }} artifact
|