-
Notifications
You must be signed in to change notification settings - Fork 0
/
runBuild.ps1
49 lines (36 loc) · 1.32 KB
/
runBuild.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
if ($env:APPVEYOR) {
$localFolder = "$env:APPVEYOR_BUILD_FOLDER"
} else {
$localFolder = "."
}
if ($env:APPVEYOR)
{
$compilerName = "compiler"
# Install docfx
(New-Object System.Net.WebClient).DownloadFile("https://github.com/dotnet/docfx/releases/download/v2.48.1/docfx.zip", "$localFolder\$compilerName.zip")
# unzip everything
Add-Type -assembly "system.io.compression.filesystem"
function Unzip($file)
{
[io.compression.zipfile]::ExtractToDirectory("$localFolder\$file.zip", "$localFolder\$file")
}
echo "Extracting Docfx"
Unzip($compilerName)
$env:Path += ";$localFolder\compiler"
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
}
git clone https://github.com/robotdotnet/wpilib "$localFolder\repos\wpilib" --depth=1
dotnet restore "$localFolder\repos\wpilib"
if (!$env:APPVEYOR) {
git checkout master
}
docfx
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
Remove-Item "$localFolder\site.zip"
Add-Type -Assembly System.IO.Compression.FileSystem
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory("$localFolder\_site\",
"$localFolder\site.zip", $compressionLevel, $false)
if ($env:APPVEYOR) {
Get-ChildItem "$localFolder\site.zip" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
}