Skip to content

Commit

Permalink
chore: improve ci powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
oberrich committed Jan 10, 2025
1 parent 724564e commit 6774d6d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,18 @@ jobs:
- name: Install Build Tools
if: matrix.os == 'windows-11-preview_aarch64'
run: |
function Log {
param(
[Parameter(Mandatory=$true)] [string]$Message,
[string]$Level = "INFO"
)
function Log { param([string]$Message, [string]$Level = "INFO")
$timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
if ($Level -eq "ERROR") {
Write-Host "$timestamp [ERROR] - $Message" -ForegroundColor Red
} else {
Write-Host "$timestamp [$Level] - $Message"
}
}
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
$deps = @(
@{ Name = 'Chocolatey'; Url = 'https://chocolatey.org/install.ps1'; Hash = $null;
Action = { & './install.ps1' }},
Expand All @@ -78,8 +74,7 @@ jobs:
$deps | ForEach-Object {
$dep = $_
if ($dep.Url -match "^https?://") {
# URL is an HTTPS URL, handle it by downloading
Log "Downloading $($dep.Name) from $($dep.Url)..."
Log "Downloading $($dep.Name) from '$($dep.Url)'..."
$install_file = Join-Path "${{ github.workspace }}" (Split-Path $dep.Url -Leaf)
Invoke-WebRequest -Uri $dep.Url -OutFile $install_file
} else {
Expand Down

0 comments on commit 6774d6d

Please sign in to comment.