diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 75d6b68..4c452fb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -92,36 +92,43 @@ jobs: - name: Use nushell if: matrix.os == 'windows-11-preview_aarch64' run: | - use std log - - let $nu_version = nu --version; - log info "Using `nu` version `$nu_version`" - - log info "Installing LLVM 19.1.5 (aarch64)..." - ^r#'${{github.workspace}}\LLVM-19.1.5-woa64.exe'# /S - log info "LLVM 19.1.5 (aarch64) installation completed." + function log { + param( + [Parameter(Mandatory=$true)] [string]$Message, + [string]$Level = "INFO" + ) + Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [$Level] - $Message" + } + + log -Level "INFO" -Message "Installing LLVM 19.1.5 (aarch64)..." + & "$env:GITHUB_WORKSPACE\LLVM-19.1.5-woa64.exe" /S + log -Level "INFO" -Message "LLVM 19.1.5 (aarch64) installation completed." - log info "Installing Git 2.48.0-rc1 (aarch64)..." - ^r#'${{github.workspace}}\Git-2.48.0-rc1-arm64.exe'# /VERYSILENT - log info "Git 2.48.0-rc1 (aarch64) installation completed." + log -Level "INFO" -Message "Installing Git 2.48.0-rc1 (aarch64)..." + & "$env:GITHUB_WORKSPACE\Git-2.48.0-rc1-arm64.exe" /VERYSILENT + log -Level "INFO" -Message "Git 2.48.0-rc1 (aarch64) installation completed." - log info "Installing Visual Studio 2022 Build Tools (aarch64)..." + log -Level "INFO" -Message "Installing Visual Studio 2022 Build Tools (aarch64)..." choco install visualstudio2022buildtools -y --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621" - log info "Visual Studio 2022 Build Tools (aarch64) installation completed." + log -Level "INFO" -Message "Visual Studio 2022 Build Tools (aarch64) installation completed." - http get "https://win.rustup.rs/aarch64" | save r#'${{github.workspace}}\rustup-init.exe'# - ^r#'${{github.workspace}}\rustup-init.exe'# --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y - log info "Rust (nightly, aarch64) installation completed." + Invoke-WebRequest -Uri "https://win.rustup.rs/aarch64" -OutFile '${{github.workspace}}\rustup-init.exe' + & '${{github.workspace}}\rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y + Write-Host 'Rust (nightly, aarch64) installation completed.' - let exports = [ - $'($env.USERPROFILE)/.cargo/bin', # Rust - $'($env.ProgramFiles)/Git/cmd', # Git - $'($env.ProgramFiles)/Git/bin', # Bash - ] + $exports = @( + "$env:USERPROFILE\.cargo\bin", # Rust + "$env:ProgramFiles\Git\cmd", # Git + "$env:ProgramFiles\Git\bin" # Bash + ) + + $exports | ForEach-Object { + $path = $_ + Add-Content -Path $env:GITHUB_PATH -Value $path + Write-Host "Added $path to `$env:GITHUB_PATH`" + } - for path in $exports { - $'($path)' | save $env.GITHUB_PATH --append - log info $'added `($path)` to `$env.GITHUB_PATH`' + foreach ($path in $exports) { } - name: Install Rust