Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Azure Pipelines to publish NuGet packages to a private Arifacts feed
resources:
- repo: self
queue:
name: Hosted Ubuntu 1604
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: 'src/lib/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: 'src/lib/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: 'src/test/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: 'src/test/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: 'src/test/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: 'Pack (Prerelease)'
inputs:
command: pack
configuration: Release
packDirectory: '$(Build.ArtifactStagingDirectory)/packages/prerelease'
nobuild: true
packagesToPack: 'src/lib/*.csproj'
buildProperties: 'VersionSuffix=".$(Build.BuildId)-prerelease"'
- task: DotNetCoreCLI@2
displayName: 'Pack (Release)'
inputs:
command: pack
configuration: Release
packDirectory: '$(Build.ArtifactStagingDirectory)/packages/release'
nobuild: true
packagesToPack: 'src/lib/*.csproj'
buildProperties: 'VersionSuffix=".$(Build.BuildId)"'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/packages'
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- readme.md
resources:
- repo: self
queue:
name: Hosted Ubuntu 1604
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: 'src/lib/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: 'src/lib/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: 'src/test/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: 'src/test/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: 'src/test/*.csproj'
arguments: '--configuration Release'
trigger: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment