Skip to content

Commit 0dd0505

Browse files
committed
Fetch scripts for installing vsb and swift
1 parent e7e8110 commit 0dd0505

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Install Visual Studio Tools
2+
description: Installs Visual Studio Tools
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Run Script
7+
shell: powershell
8+
run: .\install-vsb.ps1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
$VSB='https://aka.ms/vs/17/release/vs_buildtools.exe'
2+
$VSB_SHA256='99C7677154366062A43082921F40F3CE00EF2614DBF94DB23B244DD13DC9443D'
3+
Set-Variable ErrorActionPreference Stop
4+
Set-Variable ProgressPreference SilentlyContinue
5+
Write-Host -NoNewLine ('Downloading {0} ... ' -f ${VSB})
6+
Invoke-WebRequest -Uri $VSB -OutFile $env:TEMP\vs_buildtools.exe
7+
Write-Host 'SUCCESS'
8+
Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f $VSB_SHA256)
9+
$Hash = Get-FileHash $env:TEMP\vs_buildtools.exe -Algorithm sha256
10+
if ($Hash.Hash -eq $VSB_SHA256) {
11+
Write-Host 'SUCCESS'
12+
} else {
13+
Write-Host ('FAILED ({0})' -f $Hash.Hash)
14+
exit 1
15+
}
16+
Write-Host -NoNewLine 'Installing Visual Studio Build Tools ... '
17+
$Process =
18+
Start-Process $env:TEMP\vs_buildtools.exe -Wait -PassThru -NoNewWindow -ArgumentList @(
19+
'--quiet',
20+
'--wait',
21+
'--norestart',
22+
'--nocache',
23+
'--add', 'Microsoft.VisualStudio.Component.Windows11SDK.22000',
24+
'--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'
25+
)
26+
if ($Process.ExitCode -eq 0 -or $Process.ExitCode -eq 3010) {
27+
Write-Host 'SUCCESS'
28+
} else {
29+
Write-Host ('FAILED ({0})' -f $Process.ExitCode)
30+
exit 1
31+
}
32+
Remove-Item -Force $env:TEMP\vs_buildtools.exe

.github/workflows/swift_package_test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,17 @@ jobs:
125125
echo "image=$Image" >> "$env:GITHUB_OUTPUT"
126126
- name: Install Visual Studio Build Tools
127127
if: ${{ !inputs.enable_windows_docker }}
128-
run: . .github\workflows\scripts\windows\install-vsb.ps1
128+
run: |
129+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/install-vsb.ps1 -OutFile install-vsb.ps1
130+
. .\install-vsb.ps1
131+
del .\install-vsb.ps1
129132
- name: Install Swift
130133
if: ${{ !inputs.enable_windows_docker }}
131-
run: . .github\workflows\scripts\windows\swift\install-swift-${{ matrix.swift_version }}.ps1
134+
run: |
135+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift.ps1 -OutFile install-swift.ps1
136+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift-${{ matrix.swift_version }}.ps1 -OutFile install-swift-${{ matrix.swift_version }}.ps1
137+
. .\install-swift-${{ matrix.swift_version }}.ps1
138+
del .\install-swift*.ps1
132139
- name: Create test script
133140
run: |
134141
mkdir $env:TEMP\test-script

0 commit comments

Comments
 (0)