-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathpublish.ps1
30 lines (22 loc) · 1.78 KB
/
publish.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
Write-Host $env:APPVEYOR $env:APPVEYOR_PULL_REQUEST_NUMBER
if ($env:APPVEYOR -and $env:APPVEYOR_PULL_REQUEST_NUMBER) {
exit 0
}
$fileversion = "$env:SemVer.0"
$path = (Get-Location).Path
dotnet pack -c Release -o $path\artifacts\build -p:Version=$env:Version -p:FileVersion=$fileversion -p:SourceRevisionId=$env:APPVEYOR_REPO_COMMIT
dotnet publish src\Aguacongas.TheIdServer.Duende\Aguacongas.TheIdServer.Duende.csproj -c Release -o $path\artifacts\Aguacongas.TheIdServer.Duende -p:Version=$env:Version -p:FileVersion=$fileversion -p:SourceRevisionId=$env:APPVEYOR_REPO_COMMIT
if ($LASTEXITCODE -ne 0) {
throw "publis failed src/Aguacongas.TheIdServer/Aguacongas.TheIdServer.Duende.csproj"
}
dotnet publish src\Aguacongas.TheIdServer.BlazorApp\Aguacongas.TheIdServer.BlazorApp.csproj -c Release -o $path\artifacts\Aguacongas.TheIdServer.BlazorApp -p:Version=$env:Version -p:FileVersion=$fileversion -p:SourceRevisionId=$env:APPVEYOR_REPO_COMMIT
if ($LASTEXITCODE -ne 0) {
throw "publish failed src/Aguacongas.TheIdServer.BlazorApp/Aguacongas.TheIdServer.BlazorApp.csproj"
}
7z a $path\artifacts\build\Aguacongas.TheIdServer.Duende.$env:version.zip $path\artifacts\Aguacongas.TheIdServer.Duende
7z a $path\artifacts\build\Aguacongas.TheIdServer.BlazorApp$env:version.zip $path\artifacts\Aguacongas.TheIdServer.BlazorApp
$runtimes = "win-x86", "win-x64", "linux-x64", "osx-x64"
foreach($r in $runtimes) {
dotnet publish src\Aguacongas.TheIdServer.Duende\Aguacongas.TheIdServer.Duende.csproj -c Release -o $path\artifacts\Aguacongas.TheIdServer.Duende-$r -r $r -p:Version=$env:Version -p:FileVersion=$fileversion -p:SourceRevisionId=$env:APPVEYOR_REPO_COMMIT
7z a $path\artifacts\build\Aguacongas.TheIdServer.Duende-$r.$env:version.zip $path\artifacts\Aguacongas.TheIdServer.Duende-$r
}