forked from DSharpPlus/DSharpPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
22 lines (22 loc) · 907 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Version number
$VERSION = [int]::Parse($Env:APPVEYOR_BUILD_NUMBER).ToString("00000")
$BUILD_SUFFIX = "nightly"
# Environment variables
$Env:ARTIFACT_DIR = ".\artifacts"
# Prepare the environment
Copy-Item .\.nuget.\NuGet.config .\
$dir = New-Item -type directory $env:ARTIFACT_DIR
$dir = $dir.FullName
# Verbosity
Write-Host "Build: $VERSION"
Write-Host "Artifacts will be placed in: $dir"
# Restore NuGet packages
dotnet restore -v Minimal
# Build
dotnet build DSharpPlus.sln -v Minimal -c Release --version-suffix "$BUILD_SUFFIX" -p:BuildNumber="$VERSION"
# Package
dotnet pack DSharpPlus.sln -v Minimal -c Release -o "$dir" --no-build --version-suffix "$BUILD_SUFFIX" -p:BuildNumber="$VERSION"
# Remove Test packages
# Get-ChildItem $env:ARTIFACT_DIR | ? { $_.Name.ToLower().StartsWith("DSharpPlus.Test") } | % { $_.Delete() }
# Rebuild documentation
& .\rebuild-docs.ps1 .\docs "$dir" dsharpplus-docs