-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpsakefile.ps1
86 lines (68 loc) · 2.68 KB
/
psakefile.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
properties {
$NUGET_AUTH_TOKEN = $NUGET_AUTH_TOKEN
$build_version = $build_version
}
Task default -depends Restore, Build
Task Deploy -depends Deploy-packages
Task CI -depends Install-deps, Restore, Build, Test, Benchmark, Report
Task CD -depends CD-Build, Pack, Deploy
Task CD-Build -depends Install-deps, Restore, Build, Pack
Task Restore -depends Restore-UI {
Exec { dotnet restore }
}
Task Build {
Exec { dotnet build -c Release /p:Version=$build_version }
}
Task Install-deps {
Exec { dotnet nuget add source https://sparkshine.pkgs.visualstudio.com/StardustDL/_packaging/feed/nuget/v3/index.json -n aza -u sparkshine -p $NUGET_AUTH_TOKEN --store-password-in-clear-text }
Exec { npm install --global gulp }
Exec { dotnet tool install --global Microsoft.Web.LibraryManager.Cli }
Exec { dotnet tool install dotnet-reportgenerator-globaltool --tool-path ./tools }
}
Task Test {
if (-not (Test-Path -Path "reports/test")) {
New-Item -Path "reports/test" -ItemType Directory
}
Exec { dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutput=../../reports/test/coverage.json /p:MergeWith=../../reports/test/coverage.json /maxcpucount:1 }
Exec { dotnet test -c Release ./test/Test.Base /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../../reports/test/coverage.xml /p:MergeWith=../../reports/test/coverage.json }
}
Task Benchmark {
Exec { dotnet run -c Release --project ./test/Benchmark.Base }
}
Task Report {
Exec { ./tools/reportgenerator -reports:./reports/test/coverage.xml -targetdir:./reports/test }
if (-not (Test-Path -Path "reports/benchmark")) {
New-Item -Path "reports/benchmark" -ItemType Directory
}
Copy-Item ./BenchmarkDotNet.Artifacts/* ./reports/benchmark -Recurse
}
Task Pack {
if (-not (Test-Path -Path "packages")) {
New-Item -Path "packages" -ItemType Directory
}
Exec -maxRetries 10 { dotnet pack -c Release /p:Version=$build_version -o ./packages }
}
Task NPMUP? {
Set-Location src/RazorComponents.Markdown
Exec { ncu }
Set-Location ../..
}
Task NPMUP {
Set-Location src/RazorComponents.Markdown
Exec { ncu -u }
Exec { npm i }
Exec { npm audit fix }
Set-Location ../..
}
Task Deploy-packages {
Exec { dotnet nuget push ./packages/StardustDL.RazorComponents.Markdown.$env:build_version.nupkg -s aza -k az }
}
Task Deploy-packages-release {
Exec { dotnet nuget push ./packages/StardustDL.RazorComponents.Markdown.$env:build_version.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_AUTH_TOKEN }
}
Task Restore-UI {
Set-Location src/RazorComponents.Markdown
Exec { npm ci }
Exec { gulp }
Set-Location ../..
}