parameters: - name: VSCODE_BUILD_WIN32 type: boolean - name: VSCODE_BUILD_WIN32_ARM64 type: boolean - name: VSCODE_QUALITY type: string - name: channel type: string default: stable 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 } 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 }} - 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 - ${{ each target in parameters.VSCODE_CLI_TARGETS }}: - script: cargo build --release --target ${{ target.target }} --bin=code-tunnel displayName: Compile ${{ target.artifact }} workingDirectory: $(Build.SourcesDirectory)/cli 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: $(Build.SourcesDirectory)/cli/target/${{ target.target }}/release/code-tunnel.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