mirror of
https://github.com/XFox111/SimpleOTP.git
synced 2026-04-22 08:00:45 +03:00
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
trigger:
|
|
- master
|
|
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
|
|
variables:
|
|
buildPlatform: 'Any CPU'
|
|
buildConfiguration: 'Release'
|
|
|
|
steps:
|
|
- task: NuGetToolInstaller@1
|
|
displayName: 'Install NuGet tools'
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'Restore NuGet packages'
|
|
inputs:
|
|
command: 'restore'
|
|
restoreSolution: '**/*.sln'
|
|
feedsToUse: 'select'
|
|
|
|
- task: VSBuild@1
|
|
displayName: 'Build library'
|
|
inputs:
|
|
solution: '**/SimpleOTP.csproj'
|
|
msbuildArgs: '/p:NoWarn=AD0001'
|
|
platform: '$(buildPlatform)'
|
|
configuration: '$(buildConfiguration)'
|
|
msbuildArchitecture: 'x64'
|
|
|
|
- task: VSBuild@1
|
|
displayName: 'Build tests'
|
|
inputs:
|
|
solution: '**\*.Test.csproj'
|
|
|
|
- task: VSTest@2
|
|
displayName: 'Run tests'
|
|
inputs:
|
|
testSelector: 'testAssemblies'
|
|
testAssemblyVer2: |
|
|
**\*.Tests.dll
|
|
!**\*TestAdapter.dll
|
|
!**\obj\**
|
|
!**\bin\**\ref\**
|
|
searchFolder: '$(System.DefaultWorkingDirectory)'
|
|
codeCoverageEnabled: true
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Copy changelog'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
New-Item $(Build.ArtifactStagingDirectory)\Changelog.md
|
|
(Select-Xml -Path SimpleOTP.csproj -XPath /Project/PropertyGroup/PackageReleaseNotes | Select-Object -ExpandProperty Node).InnerText | Set-Content $(Build.ArtifactStagingDirectory)\changelog.md -Encoding UTF8
|
|
workingDirectory: '$(Build.SourcesDirectory)\SimpleOTP'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy package to staging'
|
|
inputs:
|
|
SourceFolder: '$(System.DefaultWorkingDirectory)'
|
|
Contents: '**/Release/**/*.nupkg'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
flattenFolders: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Drop artifacts'
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: 'Artifacts'
|
|
publishLocation: 'Container' |