diff options
author | Brad King <brad.king@kitware.com> | 2024-05-14 18:46:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-05-14 18:55:07 (GMT) |
commit | 0d44d2ea1ac6cf7c623e12a46b07d1380bde5d8b (patch) | |
tree | 04ce1c3c92fbe13250ce3333df14458e51862ebd /.gitlab/ci | |
parent | 5d658ebcc6df9f7de3c9ef9f3723d5cb726ba431 (diff) | |
download | CMake-0d44d2ea1ac6cf7c623e12a46b07d1380bde5d8b.zip CMake-0d44d2ea1ac6cf7c623e12a46b07d1380bde5d8b.tar.gz CMake-0d44d2ea1ac6cf7c623e12a46b07d1380bde5d8b.tar.bz2 |
ci: Add scripts to add nuget to job environment on Windows
Diffstat (limited to '.gitlab/ci')
-rw-r--r-- | .gitlab/ci/nuget-env.ps1 | 4 | ||||
-rw-r--r-- | .gitlab/ci/nuget.ps1 | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitlab/ci/nuget-env.ps1 b/.gitlab/ci/nuget-env.ps1 new file mode 100644 index 0000000..7dee5a0 --- /dev/null +++ b/.gitlab/ci/nuget-env.ps1 @@ -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 diff --git a/.gitlab/ci/nuget.ps1 b/.gitlab/ci/nuget.ps1 new file mode 100644 index 0000000..1decb01 --- /dev/null +++ b/.gitlab/ci/nuget.ps1 @@ -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" |