Skip to content

Instantly share code, notes, and snippets.

@DanielSSilva
Created June 28, 2021 22:07
Show Gist options
  • Save DanielSSilva/0c7905e516d91fda29053d6e3271584b to your computer and use it in GitHub Desktop.
Save DanielSSilva/0c7905e516d91fda29053d6e3271584b to your computer and use it in GitHub Desktop.
An example of a simple YAML pipeline for a c# proj
trigger:
- none
pool:
vmImage: 'windows-latest'
jobs:
- job: Build
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore Greeter Project'
inputs:
command: restore
projects: GreeterProject/GreeterApp/GreeterApp.csproj
feedsToUse: config
nugetConfigPath: ./nuget.config
- task: DotNetCoreCLI@2
displayName: 'Build Greeter'
inputs:
command: build
arguments: '--no-restore --configuration $(buildConfiguration)'
projects: GreeterProject/GreeterApp/GreeterApp.csproj
- task: DotNetCoreCLI@2
displayName: 'Restore Greeter Tests'
inputs:
command: restore
projects: GreeterProject/GreeterTests/GreeterTests.csproj
feedsToUse: config
nugetConfigPath: ./nuget.config
- task: DotNetCoreCLI@2
displayName: 'Build Greeter tests'
inputs:
projects: GreeterProject/GreeterTests/GreeterTests.csproj
arguments: '--no-restore --configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Test Greeter'
inputs:
command: 'test'
projects: GreeterProject/GreeterTests/GreeterTests.csproj
arguments: ' --no-build --configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Publish the Project zip'
inputs:
command: publish
publishWebProjects: false
projects: GreeterProject/GreeterApp/GreeterApp.csproj
arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)'
zipAfterPublish: True
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
condition: succeeded()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment