mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
ci: Add scripts to add nuget to job environment on Windows
This commit is contained in:
1
.gitlab/.gitignore
vendored
1
.gitlab/.gitignore
vendored
@@ -10,6 +10,7 @@
|
||||
/mingw
|
||||
/msvc*
|
||||
/ninja*
|
||||
/nuget
|
||||
/openmp
|
||||
/open-watcom*
|
||||
/orangec
|
||||
|
||||
4
.gitlab/ci/nuget-env.ps1
Normal file
4
.gitlab/ci/nuget-env.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
$pwdpath = $pwd.Path
|
||||
& "$pwsh" -File ".gitlab/ci/nuget.ps1"
|
||||
Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\nuget;$env:PATH"
|
||||
nuget | Select -First 1
|
||||
21
.gitlab/ci/nuget.ps1
Normal file
21
.gitlab/ci/nuget.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "6.9.1.3"
|
||||
$sha256sum = "562A2CE2D570D68DB4472CB82CDF1FC4245D5C73B84BC8361880CBE389702F65"
|
||||
$filename = "nuget-$version-win-i386-1"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
# This URL is only visible inside of Kitware's network.
|
||||
Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$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\nuget"
|
||||
Remove-Item "$outdir\$tarball"
|
||||
Reference in New Issue
Block a user