Skip to content

Instantly share code, notes, and snippets.

@FrankDeGroot
Last active October 8, 2025 06:34
Show Gist options
  • Select an option

  • Save FrankDeGroot/963de942879e44a6fe774e2e872d32a3 to your computer and use it in GitHub Desktop.

Select an option

Save FrankDeGroot/963de942879e44a6fe774e2e872d32a3 to your computer and use it in GitHub Desktop.
pool: default
trigger:
paths:
exclude:
- .azuredevops/release.yml
- Deployment/*
- testArtifacts/*
jobs:
- job: Build
variables:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: UseDotNet@2
name: useDotNet
inputs:
packageType: sdk
version: 8.x
- task: DotNetCoreCLI@2
name: restoreNuget
inputs:
command: restore
projects: '**/*.csproj'
feedsToUse: select
- task: DotNetCoreCLI@2
name: buildDotNet
inputs:
command: build
projects: '**/*.csproj'
arguments: >
--no-restore
--configuration Release
- task: DotNetCoreCLI@2
name: testDotNet
inputs:
command: test
projects: '**/*.csproj'
arguments: >
--no-build
--configuration Release
- task: PublishTestResults@2
name: publishTestResults
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFile: $(Agent.TempDirectory)/**/*.trx
- task: DotNetCoreCLI@2
name: publishDotNet
inputs:
command: publish
publishWebProjects: false
projects: '**/TodoItems.Api.csproj'
arguments: >
--no-restore
--configuration Release
--nologo
--no-build
--output $(Build.ArtifactStagingDirectory)/todoItemsApi
modifyOutputPath: false
zipAfterPublish: true
- publish: $(Build.ArtifactStagingDirectory)/todoItemsApi
artifact: api
name: publishApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment