summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/ispc.ps1
blob: 524896ffa0f24aebd7a766a510a67b60e0cd0911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$erroractionpreference = "stop"

$version = "1.20.0"
$sha256sum = "E212EBFB4E8AFB57ADC103A2579C52673A3CA49610FBC2A5EAE643D3D378548D"
$filename = "ispc-v$version-windows"
$tarball = "$filename.zip"

$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/ispc/ispc/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
    exit 1
}

Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
Move-Item -Path "$outdir\$filename" -Destination "$outdir\ispc"