This commit is contained in:
Jerome Laban 2020-02-09 20:33:00 -05:00
Родитель d0e82c51ac
Коммит 9d263865e3
2 изменённых файлов: 61 добавлений и 10 удалений

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

@ -20,16 +20,13 @@ jobs:
vmImage: vs2017-win2016
steps:
# if this is a tagged build, then update the version number
- powershell: |
$buildSourceBranch = "$(Build.SourceBranch)"
$tagVersion = $buildSourceBranch.Substring($buildSourceBranch.LastIndexOf("/") + 1)
Write-Host("Branch = $buildSourceBranch, Version = $tagVersion");
Write-Host ("##vso[task.setvariable variable=NugetPackageVersion;]$tagVersion")
displayName: Set NuGet Version to Tag Number
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
# restore, build and pack the packages
- task: GitVersion@5
inputs:
useConfigFile: true
configFilePath: gitversion.yml
updateAssemblyInfo: false
# restore, build and pack the packages
- task: MSBuild@1
displayName: Build Solution
inputs:
@ -42,7 +39,7 @@ jobs:
inputs:
solution: Xamarin.Essentials/Xamarin.Essentials.csproj
configuration: Release
msbuildArguments: '/t:Pack /p:PackageVersion=$(NugetPackageVersion) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
msbuildArguments: '/t:Pack /p:PackageVersion=$(GITVERSION_FullSemVer) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
# publish the packages

54
gitversion.yml Normal file
Просмотреть файл

@ -0,0 +1,54 @@
assembly-versioning-scheme: MajorMinorPatch
mode: Mainline
next-version: 1.3
branches:
master:
mode: ContinuousDeployment
regex: master
tag: dev
increment: Minor
is-source-branch-for: ['beta', 'stable']
pull-request:
regex: ^(pull|pull\-requests|pr)[/-]
mode: ContinuousDeployment
tag: 'PullRequest'
tag-number-pattern: '[/-](?<number>\d+)[-/]'
increment: none
beta:
mode: ContinuousDeployment
regex: ^release/beta/.*
tag: beta
increment: none
source-branches: ['master']
stable:
regex: ^release/stable/.*
tag: ''
increment: Patch
source-branches: ['master','beta']
is-mainline: true
dev:
mode: ContinuousDeployment
regex: ^dev/.*?/(.*?)
tag: dev.{BranchName}
source-branches: ['master', 'release', 'projects', 'feature']
increment: none
projects:
tag: ^proj-{BranchName}
regex: projects/(.*?)
source-branches: ['master']
increment: none
feature:
tag: ^feature.{BranchName}
regex: feature/(.*?)
source-branches: ['master']
increment: none
ignore:
sha: []