vscode/build/azure-pipelines/win32/cli-build-win32.yml

74 lines
2.8 KiB
YAML
Raw Normal View History

parameters:
2022-09-21 00:15:01 +08:00
- name: VSCODE_CLI_TARGETS
default: []
type: object
2022-10-06 01:05:40 +08:00
- name: VSCODE_QUALITY
type: string
2022-09-21 00:15:01 +08:00
- name: VSCODE_CLI_DIR
type: string
2022-09-21 00:15:01 +08:00
- name: VSCODE_CLI_BINARY_NAME
type: string
- name: channel
type: string
default: stable
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
parameters:
2022-09-21 00:15:01 +08:00
targets: ${{ parameters.VSCODE_CLI_TARGETS }}
2022-09-21 00:15:01 +08:00
- ${{ each target in parameters.VSCODE_CLI_TARGETS }}:
2022-10-06 01:05:40 +08:00
- 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
2022-09-21 00:15:01 +08:00
- script: cargo build --release --target ${{ target.target }} --bin=${{ parameters.VSCODE_CLI_BINARY_NAME }}
displayName: Compile ${{ target.artifact }}
workingDirectory: ${{ parameters.VSCODE_CLI_DIR }}
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)
${{ 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:
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
2022-09-21 00:15:01 +08:00
artifact: ${{ target.artifact }}
displayName: Publish ${{ target.artifact }} artifact