Skip to content

Commit

Permalink
chore: use nushell in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
oberrich committed Jan 10, 2025
1 parent 5b95deb commit 4df8a43
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,28 @@ jobs:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
$installs = @(
@{ Name = 'Chocolatey'; Url = 'https://chocolatey.org/install.ps1'; Action = { & "${{github.workspace}}\install.ps1" }},
@{ Name = 'Visual Studio 2022 Build Tools (aarch64)'; 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://win.rustup.rs/aarch64'; Action = { & '${{github.workspace}}\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'; Action = { & '${{github.workspace}}\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'; Action = { & '${{github.workspace}}\Git-2.48.0-rc2-arm64.exe' /VERYSILENT }}
@{ 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 = 'Rust (nightly, aarch64)'; Url = 'https://win.rustup.rs/aarch64'; Hash = $null; Action = { & '${{github.workspace}}\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 = ''; Action = { & '${{github.workspace}}\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 = { & '${{github.workspace}}\Git-2.48.0-rc2-arm64.exe' /VERYSILENT }}
)
$installs | ForEach-Object {
if ($_.Url -ne $null) {
Write-Host "Downloading $($_.Name) from $($_.Url)..."
Invoke-WebRequest -Uri $_.Url -OutFile ("${{github.workspace}}\" + (Split-Path $_.Url -Leaf))
Write-Host "Downloading $($_.Name) from $($_.Url)..."
Invoke-WebRequest -Uri $_.Url -OutFile (Join-Path ${{github.workspace}} (Split-Path $_.Url -Leaf))
if ($_.Hash) {
$downloadedHash = (Get-FileHash -Path $filePath -Algorithm SHA256).Hash
if ($downloadedHash -eq $_.Hash) {
Write-Host "$($_.Name) hash verified successfully."
} else {
Write-Host "Hash mismatch for $($_.Name). Expected: $($_.Hash), Got: $downloadedHash"
Log "Failed to verify hash for $($_.Name)."
return
}
} else {
Write-Host "No hash specified for $($_.Name). Skipping hash verification."
}
Log "Starting installation of $($_.Name)..."
Expand Down

0 comments on commit 4df8a43

Please sign in to comment.