Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
trigger:
branches:
include:
- master
- release
- refs/tags/*
pr:
- master
pool:
vmImage: 'windows-2019'
variables:
BuildConfiguration: Release
Projects: 'src/NSwag.sln'
steps:
# Install required SDKs and tools
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '5.0.100'
- task: CmdLine@2
displayName: 'Install DNT'
inputs:
script: 'npm i -g dotnettools'
- task: CmdLine@2
displayName: 'Install WiX Toolset'
inputs:
script: 'choco install wixtoolset'
- task: CmdLine@2
displayName: 'Patch project version (preview)'
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
script: 'dnt bump-versions preview "$(Build.BuildNumber)"'
failOnStderr: true
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: '$(Projects)'
includeNuGetOrg: true
# Build and test
- task: MSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(Projects)'
msbuildArchitecture: 'x86'
configuration: '$(BuildConfiguration)'
- task: VSTest@2
displayName: 'Run tests'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\*Integration*.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
configuration: '$(BuildConfiguration)'
# Publish artifacts
- task: CopyFiles@2
displayName: 'Copy packages'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
Contents: '**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
displayName: 'Copy MSI'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
Contents: '**/*.msi'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'