80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
# ASP.NET Core
|
|
|
|
name: 'MaidBotAPI.$(Build.SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)'
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- '*'
|
|
|
|
pool:
|
|
name: LCUOnPrem
|
|
|
|
variables:
|
|
buildConfiguration: 'Release'
|
|
|
|
steps:
|
|
- task: DotNetCoreCLI@2
|
|
inputs:
|
|
command: 'restore'
|
|
feedsToUse: 'select'
|
|
vstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
inputs:
|
|
command: 'build'
|
|
projects: '**/*.csproj'
|
|
arguments: '--configuration $(buildConfiguration)'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Test
|
|
inputs:
|
|
command: test
|
|
projects: '**/*.Tests.csproj'
|
|
arguments: '--configuration $(BuildConfiguration) --collect "Code coverage" --settings additional_test_args.runsettings'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet publish $(buildConfiguration)'
|
|
inputs:
|
|
command: 'publish'
|
|
publishWebProjects: false
|
|
projects: '**/*.csproj'
|
|
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: Copy Nuget Package to artifact staging directory
|
|
inputs:
|
|
SourceFolder: './LCU.Api.Internal.MaidBotSeqApp/bin/$(BuildConfiguration)/'
|
|
Contents: '*.nupkg'
|
|
TargetFolder: '$(build.artifactstagingdirectory)'
|
|
OverWrite: true
|
|
|
|
- task: NuGetCommand@2
|
|
condition: and (succeeded(), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'main')) )
|
|
displayName: 'NuGet push'
|
|
inputs:
|
|
command: push
|
|
packagesToPush: 'LCU.Api.Internal.MaidBotLib/bin/Release/*.nupkg'
|
|
publishVstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
|
allowPackageConflicts: true
|
|
|
|
- task: MSBuild@1
|
|
displayName: Build sql project
|
|
inputs:
|
|
solution: './LCU.Api.Internal.MaidBotSql/LCU.Api.Internal.MaidBotSql.sqlproj'
|
|
configuration: 'Release'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: Copy dacpac to artifact staging directory
|
|
inputs:
|
|
SourceFolder: './LCU.Api.Internal.MaidBotSql/bin/$(BuildConfiguration)/'
|
|
Contents: 'LCU.Api.Internal.MaidBotSql.dacpac'
|
|
TargetFolder: '$(build.artifactstagingdirectory)'
|
|
OverWrite: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: and (succeeded(), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'main')) )
|
|
displayName: 'Publish Artifact: dist'
|
|
inputs:
|
|
PathtoPublish: '$(build.artifactstagingdirectory)'
|
|
ArtifactName: 'dist'
|