From ff3f9be19b3fc624a48f7df6e3d20fc2816dc35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Wed, 15 Nov 2023 10:22:30 +0100 Subject: [PATCH] ci: preparing Windows MSVC environment --- .../workflows/build-x86_64-pc-windows-msvc.yaml | 4 ++-- .../Prepare-BuildEnvironment.ps1 | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 support/rust-build/x86_64-pc-windows-msvc/Prepare-BuildEnvironment.ps1 diff --git a/.github/workflows/build-x86_64-pc-windows-msvc.yaml b/.github/workflows/build-x86_64-pc-windows-msvc.yaml index f6cbd8f..685dabb 100644 --- a/.github/workflows/build-x86_64-pc-windows-msvc.yaml +++ b/.github/workflows/build-x86_64-pc-windows-msvc.yaml @@ -39,9 +39,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-x86_64-self-hosted] + os: [x86_64-pc-windows-msvc-self-hosted] include: - - os: windows-x86_64-self-hosted + - os: x86_64-pc-windows-msvc-self-hosted ASSET_PATH: "rust/build/dist/rust-nightly-x86_64-pc-windows-msvc.zip" ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-x86_64-pc-windows-msvc.zip" ASSET_CONTENT_TYPE: "application/x-tar" diff --git a/support/rust-build/x86_64-pc-windows-msvc/Prepare-BuildEnvironment.ps1 b/support/rust-build/x86_64-pc-windows-msvc/Prepare-BuildEnvironment.ps1 new file mode 100644 index 0000000..0d4bdae --- /dev/null +++ b/support/rust-build/x86_64-pc-windows-msvc/Prepare-BuildEnvironment.ps1 @@ -0,0 +1,15 @@ +# Requires elevation of privileges + +winget install --id Git.Git --accept-source-agreements +winget install --id 7zip.7zip +winget install --id Python.Python.3.12 --scope machine + +$ProgressPreference = 'SilentlyContinue' +wget https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe +.\vs_buildtools.exe --passive --wait --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621 + +# winget installation failed with an error, using vs_buildtools.exe instead +#winget install -e --id Microsoft.WindowsSDK +#winget install Microsoft.VisualStudio.2022.BuildTools --silent --override "--wait --quiet --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + +setx /M PATH "$env:PATH;C:\Program Files\7-Zip"