Skip to content

Commit 74c2fd2

Browse files
committed
fix(ci): support pre-release versions in tags
1 parent 1a860c4 commit 74c2fd2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Build.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ echo "VERSION-SUFFIX: alpha1-$revision"
1414

1515
If($env:APPVEYOR_REPO_TAG -eq $true) {
1616
echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts "
17-
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts
17+
$revision = Get-Version-Suffix-From-Tag
18+
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision
1819
}
1920
Else {
2021
echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision"
2122
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision
2223
}
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
34+
}

0 commit comments

Comments
 (0)