-
-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathrun-all.ps1
52 lines (41 loc) · 2.06 KB
/
run-all.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
param([String]$VersionPrefix="1.0.0", [String]$VersionSuffix="") #Must be the first statement in your script
$scriptDir = Split-Path $myinvocation.mycommand.path -Parent
$root = Split-Path $scriptDir -Parent
## Prefix the suffix with a dash if set.
if($VersionSuffix) {
$VersionSuffixPath = "-" + $VersionSuffix
}
# Check for confirmation
Write-Host "This will call setVersion, pack and publish both projects to nuget."
Write-Host -background yellow -foreground black "Version: $VersionPrefix$VersionSuffixPath"
$confirmation = Read-Host "Are you Sure You Want To Proceed [y]"
if ($confirmation -ne 'y') {exit}
# proceed
& (join-path $scriptDir "setVersion.ps1") -VersionPrefix $VersionPrefix -VersionSuffix $VersionSuffix
& (join-path $scriptDir "buildRelease.ps1")
#& (join-path $scriptDir "packRelease.ps1")
if ($? -eq $false) {
write-host -background DarkBlue -foreground Red "<Error Exit>"
exit 1
}
$target1 = Join-Path $root "Src\Fido2\bin\Release\Fido2.$VersionPrefix$VersionSuffixPath.nupkg"
$target2 = Join-Path $root "Src\Fido2.Models\bin\Release\Fido2.Models.$VersionPrefix$VersionSuffixPath.nupkg"
$target3 = Join-Path $root "Src\Fido2.AspNet\bin\Release\Fido2.AspNet.$VersionPrefix$VersionSuffixPath.nupkg"
if (
((Test-Path $target1) -eq $false) -Or ((Test-Path $target2) -eq $false) -Or ((Test-Path $target3) -eq $false)) {
write-host -background DarkBlue -foreground Red "Could not locate nupkg"
Write-Host "Path1 $target1"
Write-Host "Path2 $target2"
Write-Host "Path2 $target3"
exit 1
}
Write-Host "Ready to publish $target1"
Write-Host "Ready to publish $target2"
Write-Host "Ready to publish $target3"
Write-Host -background yellow -foreground black "Version: $VersionPrefix$VersionSuffixPath"
$confirmation = Read-Host "Are you Sure You Want To Proceed (y)"
if ($confirmation -ne 'y') {exit}
& (join-path $scriptDir "publish.ps1") -path $target2
& (join-path $scriptDir "publish.ps1") -path $target1
& (join-path $scriptDir "publish.ps1") -path $target3
Write-Host "Done. Update to $VersionPrefix $VersionSuffix and published to nuget."