summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab/.gitignore1
-rw-r--r--.gitlab/ci/nuget-env.ps14
-rw-r--r--.gitlab/ci/nuget.ps121
3 files changed, 26 insertions, 0 deletions
diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore
index 552c02c..0558700 100644
--- a/.gitlab/.gitignore
+++ b/.gitlab/.gitignore
@@ -10,6 +10,7 @@
/mingw
/msvc*
/ninja*
+/nuget
/openmp
/open-watcom*
/orangec
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"