Skip to content

Instantly share code, notes, and snippets.

@AndrewAllison
Created September 10, 2020 13:54
Show Gist options
  • Save AndrewAllison/2e0063a4b92cc593c0527543f99eb29b to your computer and use it in GitHub Desktop.
Save AndrewAllison/2e0063a4b92cc593c0527543f99eb29b to your computer and use it in GitHub Desktop.
trigger:
- master
- develop
- feature/*
pool:
vmImage: 'windows-2019'
variables:
configuration: 'Release'
projectPath: '<path-to-Project>'
majorMinorVersion: 1.0
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: UseDotNet@2
displayName: 'Installing .NET core SDK'
inputs:
packageType: 'sdk'
version: '3.1.302'
- task: DotNetCoreCLI@2
displayName: 'Building project'
inputs:
command: 'build'
projects: '$(projectPath)'
- task: SemanticVersioning@1
displayName: 'Creating semanticVersion'
inputs:
configFile: '.semver.yml'
- script: "echo $(Build.BuildNumber)"
- task: DotNetCoreCLI@2
displayName: 'Packing up the project'
inputs:
command: 'pack'
packagesToPack: '$(projectPath)'
configuration: 'Release'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: PublishBuildArtifacts@1
displayName: 'Publish the Package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment