[Build] Update version numbers to ship from yaml (#8437)

* Update version numbers

* Update Version.targets

* Fix variables

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml
This commit is contained in:
Rui Marinho 2019-11-13 23:44:47 +00:00 коммит произвёл Samantha Houts
Родитель 6351caa8f4
Коммит 4b9c1396c5
2 изменённых файлов: 25 добавлений и 6 удалений

Просмотреть файл

@ -1,22 +1,24 @@
<Project>
<PropertyGroup>
<NightlyTag>nightly</NightlyTag>
<RegexPre>pre\d</RegexPre>
</PropertyGroup>
<PropertyGroup>
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' != ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH)</GitBranch>
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' == '' and '$(BUILD_SOURCEBRANCHNAME)' != ''">$(BUILD_SOURCEBRANCHNAME)</GitBranch>
</PropertyGroup>
<PropertyGroup>
<GitSemVerLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">$(NightlyTag)</GitSemVerLabel>
<GitSemVerDashLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">-$(GitSemVerLabel)</GitSemVerDashLabel>
</PropertyGroup>
<Target Name="SetVersions"
BeforeTargets="PrepareForBuild;GetAssemblyVersion;GetPackageVersion;Pack"
DependsOnTargets="GitVersion"
Returns="$(Version)"
>
<PropertyGroup>
<PreOut>$([System.Text.RegularExpressions.Regex]::Match($(GitTag), $(RegexPre)))</PreOut>
<GitSemVerLabel Condition=" '$(GitTag)' != '' and '$(GitTag)' == '$(GitBranch)' and $([System.Text.RegularExpressions.Regex]::IsMatch('$(GitTag)', $(RegexPre))) ">$(PreOut)</GitSemVerLabel>
<GitSemVerLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">$(NightlyTag)</GitSemVerLabel>
<GitSemVerDashLabel Condition="'$(GitSemVerLabel)' != ''" >-$(GitSemVerLabel)</GitSemVerDashLabel>
</PropertyGroup>
<ItemGroup>
<VersionMetadata Include="$(GitCommits)" Condition="'$(GitSemVerDashLabel)' == ''" />
@ -34,7 +36,11 @@
<VersionMetadataPlusLabel Condition="'$(VersionMetadataLabel)' != ''">+$(VersionMetadataLabel)</VersionMetadataPlusLabel>
<Version>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)</Version>
<PackageVersion>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
<PackageVersion Condition="$(CI)">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch).$(BUILDVERSION)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
<PackageVersion Condition="$(CI) and '$(GitBaseVersion)' == '4.2.0'">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch).$(BUILDVERSION42)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
<PackageVersion Condition="$(CI) and '$(GitBaseVersion)' == '4.3.0'">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch).$(BUILDVERSION43)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
<PackageVersion Condition="$(CI) and '$(GitBaseVersion)' == '4.4.0'">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch).$(BUILDVERSION44)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
</PropertyGroup>
<PropertyGroup>

Просмотреть файл

@ -10,7 +10,13 @@ variables:
- name: SolutionFile
value: Xamarin.Forms.sln
- name: BuildVersion
value: $[counter('$(Build.SourceBranchName)_counter', 1)]
value: $[counter(variables['Build.SourceBranch'], 1)]
- name: BuildVersion42
value: $[counter('4.2.0', 910311)]
- name: BuildVersion43
value: $[counter('4.3.0', 991211)]
- name: BuildVersion44
value: $[counter('4.4.0', 991210)]
- name: NUGET_VERSION
value: 5.0.2
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
@ -44,6 +50,13 @@ pr:
- 4.*
- 3.*
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
jobs:
- template: build/steps/build-windows.yml
parameters: