forked from DSharpPlus/DSharpPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold-script.ps1
42 lines (33 loc) · 1.23 KB
/
old-script.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
# Old script from AppVeyor. Stored for archiving purposes.
# Version number
$VERSION = [int]::Parse($Env:APPVEYOR_BUILD_NUMBER).ToString("00000")
# 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
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode); }
# Build
dotnet build DSharpPlus.sln -v Minimal -c Release --version-suffix "$VERSION"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode); }
# Package
dotnet pack DSharpPlus.sln -v Minimal -c Release -o "$dir" --no-build --version-suffix "$VERSION"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode); }
# Remove Test packages
# Get-ChildItem $env:ARTIFACT_DIR | ? { $_.Name.ToLower().StartsWith("DSharpPlus.Test") } | % { $_.Delete() }
# Check if this is a PR
if (-not $Env:APPVEYOR_PULL_REQUEST_NUMBER)
{
# Rebuild documentation
& .\rebuild-docs.ps1 .\docs "$dir" dsharpplus-docs
}
else
{
Write-Host "Building from PR ($Env:APPVEYOR_PULL_REQUEST_NUMBER); skipping docs build"
}