From a0fcb43d31ba5c11f383127368d63f1037a3c18d Mon Sep 17 00:00:00 2001 From: oberrich Date: Fri, 10 Jan 2025 08:40:38 +0100 Subject: [PATCH] chore: improve ci powershell --- .github/workflows/rust.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 24be9fe..db622b5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,22 +45,22 @@ jobs: [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 $installs = @( - @{ Name = 'Chocolatey'; Url = 'https://chocolatey.org/install.ps1'; Hash = $null; - Action = { & '${{ github.workspace }}/install.ps1' }}, - @{ Name = 'Visual Studio 2022 Build Tools (aarch64)'; Hash = $null; Url = $null; - Action = { choco install visualstudio2022buildtools -y --no-progress --silent --package-parameters '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621' }}, + # @{ Name = 'Chocolatey'; Url = 'https://chocolatey.org/install.ps1'; Hash = $null; + # Action = { & './install.ps1' }}, + # @{ Name = 'Visual Studio 2022 Build Tools (aarch64)'; Hash = $null; Url = $null; + # Action = { choco install visualstudio2022buildtools -y --no-progress --silent --package-parameters '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621' }}, @{ Name = 'Rust (nightly, aarch64)'; Url = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe'; Hash = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe.sha256'; - Action = { & 'rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y }}, + Action = { & './rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y }}, @{ Name = 'LLVM 19.1.5'; Url = 'https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.5/LLVM-19.1.5-woa64.exe'; Hash = '63D479C19C3908F8C973331EDC9B576485EAB6AB0809F58C79DF5D209FDD8F96'; - Action = { & 'LLVM-19.1.5-woa64.exe' /S }}, + Action = { & './LLVM-19.1.5-woa64.exe' /S }}, @{ Name = 'Git 2.48.0-rc1'; Url = 'https://github.com/git-for-windows/git/releases/download/v2.48.0-rc2.windows.1/Git-2.48.0-rc2-arm64.exe'; Hash = '712739bb49832d571732e3e74b111d7cb4a63cd622ef3e87d01efe35046d9a4f'; - Action = { & 'Git-2.48.0-rc2-arm64.exe' /VERYSILENT }} + Action = { & './Git-2.48.0-rc2-arm64.exe' /VERYSILENT }} ) $installs | ForEach-Object { @@ -81,10 +81,10 @@ jobs: $downloaded_hash = (Get-FileHash -Path $install_file -Algorithm SHA256).Hash if ($downloaded_hash -eq $expected_hash) { - Log "Hash verified successfully." + Log "Hash verified successfully." } else { - Log "Hash mismatch for $($_.Name). Expected: $expected_hash, Got: $downloaded_hash" -Level "ERROR" - exit 1 + Log "Hash mismatch for $($_.Name). Expected: $expected_hash, Got: $downloaded_hash" -Level "ERROR" + exit 1 } } else { Log "No hash specified, skipping verification." @@ -92,10 +92,10 @@ jobs: Log "Starting installation of $($_.Name)..." try { - & $_.Action > $null 2>&1 - Log "$_.Name installation completed." + & $_.Action > $null 2>&1 + Log "$($_.Name) installation completed." } catch { - Log "Failed to install $_.Name" -Level "ERROR" + Log "Failed to install $($_.Name)." -Level "ERROR" } }