Skip to content

Commit 34aabb6

Browse files
committed
fix build script
1 parent 74c2fd2 commit 34aabb6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Build.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Gets the version suffix from the repo tag
2+
# example: v1.0.0-preview1-final => preview1-final
3+
function Get-Version-Suffix-From-Tag
4+
{
5+
$tag=$env:APPVEYOR_REPO_TAG_NAME
6+
$split=$tag -split "-"
7+
$suffix=$split[1..2]
8+
$final=$suffix -join "-"
9+
return $c
10+
}
11+
112
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
213
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
314

@@ -15,20 +26,9 @@ echo "VERSION-SUFFIX: alpha1-$revision"
1526
If($env:APPVEYOR_REPO_TAG -eq $true) {
1627
echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts "
1728
$revision = Get-Version-Suffix-From-Tag
18-
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision
29+
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision
1930
}
2031
Else {
2132
echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision"
2233
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision
23-
}
24-
25-
# Gets the version suffix from the repo tag
26-
# example: v1.0.0-preview1-final => preview1-final
27-
function Get-Version-Suffix-From-Tag
28-
{
29-
$tag=$env:APPVEYOR_REPO_TAG_NAME
30-
$split=$tag -split "-"
31-
$suffix=$split[1..2]
32-
$final=$suffix -join "-"
33-
return $c
3434
}

0 commit comments

Comments
 (0)