mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
gitlab: add powershell scripts for utilities
This commit is contained in:
18
.gitlab/ci/cmake.ps1
Executable file
18
.gitlab/ci/cmake.ps1
Executable file
@@ -0,0 +1,18 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "3.17.2"
|
||||
$sha256sum = "CF82B1EB20B6FBE583487656FCD496490FFCCDFBCBBA0F26E19F1C9C63B0B041"
|
||||
$filename = "cmake-$version-win64-x64"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/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\cmake"
|
||||
17
.gitlab/ci/ninja.ps1
Executable file
17
.gitlab/ci/ninja.ps1
Executable file
@@ -0,0 +1,17 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "1.10.0"
|
||||
$sha256sum = "919FD158C16BF135E8A850BB4046EC1CE28A7439EE08B977CD0B7F6B3463D178"
|
||||
$filename = "ninja-win"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/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")
|
||||
22
.gitlab/ci/sccache.ps1
Executable file
22
.gitlab/ci/sccache.ps1
Executable file
@@ -0,0 +1,22 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
# 0.2.13 is unavailable right now.
|
||||
# https://github.com/mozilla/sccache/issues/677
|
||||
$version = "0.2.12"
|
||||
$sha256sum = "FD05E91C59B9497D4EBAE311B47A982F2A6EB942DCA3C9C314CC1FB36F8BC64D"
|
||||
$filename = "sccache-$version-x86_64-pc-windows-msvc"
|
||||
$tarball = "$filename.tar.gz"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
Invoke-WebRequest -Uri "https://github.com/mozilla/sccache/releases/download/$version/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
$curdir = $pwd.Path
|
||||
Set-Location -Path "$outdir"
|
||||
cmake -E tar xzf "$outdir\$tarball"
|
||||
Move-Item -Path "$outdir\$filename\sccache.exe" -Destination "$outdir\sccache.exe"
|
||||
Set-Location -Path "$curdir"
|
||||
9
.gitlab/ci/vcvarsall.ps1
Executable file
9
.gitlab/ci/vcvarsall.ps1
Executable file
@@ -0,0 +1,9 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
cmd /c "`"$env:VCVARSALL`" $VCVARSPLATFORM & set" |
|
||||
foreach {
|
||||
if ($_ -match "=") {
|
||||
$v = $_.split("=")
|
||||
[Environment]::SetEnvironmentVariable($v[0], $v[1])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user