Update CI to support official releases, dependencies and the version to RTM.

pull/101/head
Laurents Meyer 5 years ago
parent fedc4cc226
commit 523c644c95

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<EFCoreVersion>[3.1.10, 5.0.0)</EFCoreVersion>
<MicrosoftExtensionsVersion>3.1.10</MicrosoftExtensionsVersion>
<EFCoreVersion>[3.1.15, 5.0.0)</EFCoreVersion>
<MicrosoftExtensionsVersion>3.1.15</MicrosoftExtensionsVersion>
</PropertyGroup>
<ItemGroup>
@ -26,8 +26,8 @@
<PackageReference Update="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.0" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
<!--<PackageReference Update="Microsoft.EntityFrameworkCore" Version="$(MicrosoftEntityFrameworkCoreVersion)" />-->
<!--<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(MicrosoftEntityFrameworkCoreRelationalVersion)" />-->

@ -9,18 +9,19 @@
- "servicing"
-->
<VersionPrefix>3.1.0</VersionPrefix>
<PreReleaseVersionLabel>alpha</PreReleaseVersionLabel>
<PreReleaseVersionIteration>5</PreReleaseVersionIteration>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>
<!--
The following properties will automatically be set by CI builds when appropriate:
OfficialVersion
ContinuousIntegrationTimestamp
BuildSha
-->
</PropertyGroup>
<!--
If no version or else version suffix has been explicitly set, we generate one in the following format:
If no version or version suffix or official version has been explicitly set, we generate a version suffix in the following format:
alpha.1.ci.20201004T181121Z+sha.0a1b2c3
-->
<PropertyGroup>
@ -28,7 +29,7 @@
<UseVersionSuffixOverride Condition="'$(VersionSuffix)' != ''">true</UseVersionSuffixOverride>
</PropertyGroup>
<PropertyGroup Label="Version Suffix Handling" Condition="'$(UseVersionOverride)' != 'true' And '$(UseVersionSuffixOverride)' != 'true'">
<PropertyGroup Label="Version Suffix Handling" Condition="'$(UseVersionOverride)' != 'true' And '$(UseVersionSuffixOverride)' != 'true' And '$(OfficialVersion)' == ''">
<VersionSuffix>$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)</VersionSuffix>
<VersionSuffix Condition="'$(ContinuousIntegrationTimestamp)' != ''">$(VersionSuffix).ci.$(ContinuousIntegrationTimestamp)</VersionSuffix>
<VersionSuffix Condition="'$(BuildSha)' != ''">$(VersionSuffix)+sha.$(BuildSha)</VersionSuffix>
@ -38,7 +39,7 @@
<Error Condition="'$(VersionPrefix)' == ''" Text="The 'VersionPrefix' property needs to be set." />
<Error Condition="'$(PreReleaseVersionLabel)' == ''" Text="The 'PreReleaseVersionLabel' property needs to be set." />
<Error Condition="'$(PreReleaseVersionIteration)' == ''" Text="The 'PreReleaseVersionIteration' property needs to be set." />
<Error Condition="'$(OfficialVersion)' != '' And '$(OfficialVersion)' != '$(VersionPrefix)'" Text="The 'OfficialVersion' property needs to be identical to the 'VersionPrefix' property." />
<!--
<Message Importance="high" Text="VersionPrefix: $(VersionPrefix)" />
<Message Importance="high" Text="VersionSuffix: $(VersionSuffix)" />

@ -135,7 +135,8 @@ jobs:
- pwsh: dotnet --info
displayName: .NET Information
- pwsh: |
$officialBuild = '$(Build.SourceBranch)' -match '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+'
$officialBuild = '$(Build.SourceBranch)' -match '(?<=^refs/tags/v)\d+\.\d+\.\d+$'
$officialVersion = $Matches.0
$wipBuild = '$(Build.SourceBranch)' -match '^refs/heads/.*-wip$'
$ciBuildOnly = $wipBuild -or ('$(Build.SourceBranch)' -match '^refs/heads/(?:master|.*-servicing)$')
$continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss
@ -143,6 +144,7 @@ jobs:
$pack = $officialBuild -or $ciBuildOnly -or $wipBuild
echo "officialBuild: $officialBuild"
echo "officialVersion: $officialVersion"
echo "wipBuild: $wipBuild"
echo "ciBuildOnly: $ciBuildOnly"
echo "continuousIntegrationTimestamp: $continuousIntegrationTimestamp"
@ -153,6 +155,11 @@ jobs:
{
$arguments = 'pack', '-c', 'Release', '-o', '$(Build.ArtifactStagingDirectory)', '-p:ContinuousIntegrationBuild=true'
if ($officialBuild)
{
$arguments += "-p:OfficialVersion=$officialVersion"
}
if ($ciBuildOnly)
{
$arguments += "-p:ContinuousIntegrationTimestamp=$continuousIntegrationTimestamp"

Loading…
Cancel
Save