trigger:
  branches:
    include:
    - master
  tags:
    include:
    - '*'

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: GitVersion@5
  inputs:
    runtime: 'core'
    updateAssemblyInfo: true

- script: dotnet restore
  displayName: Restore

- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    command: build
    projects: '**/*.csproj'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: Test
  inputs:
    command: test
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'

- task: DotNetCoreCLI@2
  displayName: Pack
  inputs:
    command: 'pack'
    packagesToPack: '**/*.csproj;-:**/*Tests/*.csproj'
    nobuild: true    
    versioningScheme: 'byEnvVar'
    versionEnvVar: 'GITVERSION_NUGETVERSION'

- task: DotNetCoreCLI@2
  displayName: Push
  inputs:
    command: 'push'
    packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: '/640f77ba-a1d6-45f8-a237-2fff94af3f1d'

Set up CI with Azure Pipelines
Set up CI with Azure Pipelines

[skip ci]