Skip to content

Instantly share code, notes, and snippets.

@brbarnett
Created January 16, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brbarnett/f7f4788f13d9a70bdd6ef997180a7c1e to your computer and use it in GitHub Desktop.
Save brbarnett/f7f4788f13d9a70bdd6ef997180a7c1e to your computer and use it in GitHub Desktop.
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