1 Star 0 Fork 2

吴冬/XbimWindowsUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
azure-pipelines.yml 5.90 KB
一键复制 编辑 原始数据 按行查看 历史
Andy Ward 提交于 2019-06-03 10:58 . Final 5.1 version changes (#117)
# Yaml Pipeline Tasks for reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/index?view=vsts
trigger:
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- CHANGELOG.md
- CONTRIBUTING.md
pool:
vmImage: 'VS2017-Win2016'
variables:
solution: '*.sln'
BuildConfiguration: 'Release'
BuildPlatform: 'Any CPU'
major: 5
minor: 1
# creates a named counter and seeds it at 100 and then assigns the value to a variable named buildNo.
buildNo: $[counter('winversioncounter', 100)]
name: $(BuildDefinitionName)_$(SourceBranchName)_$(major).$(minor).$(buildNo)
steps:
# Windows script setting up $(packageversion) of the nuget package based on branch
# Master branch
- script: |
echo ##vso[task.setvariable variable=packageversion]$(major).$(minor).$(buildNo)
displayName: 'Setting Nuget PackageVersion'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# Any other branch
- script: |
echo ##vso[task.setvariable variable=packageversion]$(major).$(minor).$(buildNo)-$(Build.SourceBranchName)
displayName: 'Setting Prerelease Nuget PackageVersion'
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
# Windows script setting up $(fileversion) used to stamp AssemblyFileVersions.
# By convention we use 'Major.Minor.BuildNo.0' on Master and 'Major.Minor.0.BuildNo' on other branches
# Master branch
- script: |
echo ##vso[task.setvariable variable=fileversion]$(major).$(minor).$(buildNo).0
displayName: 'Setting FileVersion'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
# Any other branch
- script: |
echo ##vso[task.setvariable variable=fileversion]$(major).$(minor).0.$(buildNo)
displayName: 'Setting Prerelease FileVersion'
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
#Task group has not been exported, task groups are not supported yet
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.6.2'
inputs:
versionSpec: '4.6.2'
# Version .NET Core project files
# Description - Applies a version to a .NET Core assembly via the .csproj files based on the build number.
# Based on https://github.com/rfennell/AzurePipelines/wiki/Version-Assemblies-and-Packages-Tasks-YAML#versiondotnetcoreassembliestask
- task: VersionDotNetCoreAssemblies@2
displayName: 'Version *.csproj (netcore)'
inputs:
Path: $(Build.SourcesDirectory)
VersionNumber: $(fileversion)
VersionRegex: \d+\.\d+\.\d+\.\d+
FilenamePattern: .csproj
Field: FileVersion
OutputVersion: OutputedVersion
# Version 'classic' .NET Assemblies
# Description - Applies a version to a .NET assembly via the assemblyinfo.cs or .vb files based on the build number.
# For the Plugin project(s) which are ClickOnce
- task: VersionAssemblies@2
displayName: 'Set AssemblyFileVersion in AssemblyInfo.cs - $(fileversion)'
inputs:
Path: $(Build.SourcesDirectory)
VersionNumber: $(fileversion)
VersionRegex: \d+\.\d+\.\d+\.\d+
FilenamePattern: AssemblyInfo.cs
Field: AssemblyFileVersion
OutputVersion: OutputedVersion
# nuget restore sln
- task: NuGetCommand@2
displayName: 'NuGet restore solution'
inputs:
restoreSolution: '$(solution)'
feedsToUse: config
nugetConfigPath: 'nuget.config'
# vs2017 build
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(solution)'
msbuildArgs: '/t:build'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
# Delete all Package(s) including newly built - we're going to regenerate with the current build version
- task: DeleteFiles@1
displayName: 'Delete old *.nupkg files from $(build.sourcesdirectory)'
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: '**\bin\$(BuildConfiguration)\**\*.nupkg'
# Pack with MSBuild since dotnet pack can't do WPF
- task: MSBuild@1
inputs:
solution: Xbim.Presentation/Xbim.Presentation.csproj
msbuildVersion: 'latest'
platform: AnyCPU
configuration: $(BuildConfiguration)
msbuildArguments: '/t:pack /p:PackageVersion=$(packageversion)'
clean: false
# Pack XplorerPlugin.Bcf with nuget and nuspec. Because nothing else works with ClickOnce
- task: NuGetCommand@2
displayName: 'NuGet pack BCF_Plugin'
inputs:
command: pack
packagesToPack: 'XplorerPlugin.Bcf.plugin.nuspec'
configuration: $(BuildConfiguration)
versioningScheme: byEnvVar
versionEnvVar: packageversion
# Test, but don't fail
- task: VSTest@2
displayName: 'VsTest - testAssemblies'
inputs:
testAssemblyVer2: |
**\bin\$(BuildConfiguration)\**\**Tests.dll
codeCoverageEnabled: true
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
continueOnError: true
- task: PublishSymbols@1
displayName: 'Publish symbols path: '
inputs:
SearchPattern: '**\bin\**\*.pdb'
enabled: false
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: '**\bin\$(BuildConfiguration)\*.nupkg'
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
# Publish to master or develop MyGet feed based on the source branch
- task: NuGetCommand@2
name: 'MyGetPublishing_Master'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'MyGetMaster'
versioningScheme: byEnvVar
versionEnvVar: version
- task: NuGetCommand@2
name: 'MyGetPublishing_Develop'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/develop')
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'MyGetDev'
versioningScheme: byEnvVar
versionEnvVar: version
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/wdhust/XbimWindowsUI.git
git@gitee.com:wdhust/XbimWindowsUI.git
wdhust
XbimWindowsUI
XbimWindowsUI
master

搜索帮助