trigger:
  branches:
    include:
      - master
      - rel/*
  paths:
    include:
      - src/SignService/*
      - scripts/Install-WindowsSdkISO.ps1
      - .editorconfig
      - azure-pipelines.server.yml
      - version.json

pr:
  branches:
    include:
      - master
      - rel/*
  paths:
    include:
      - src/SignService/*
      - scripts/Install-WindowsSdkISO.ps1
      - .editorconfig
      - azure-pipelines.server.yml
      - version.json

pool:
  vmImage: windows-2019

variables: 
  BuildConfiguration: Release
  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- task: DotNetCoreInstaller@0
  inputs:
    version: '2.1.105'

- task: DotNetCoreCLI@2
  displayName: Copy sdk files locally before build
  inputs:
    command: custom
    projects: src/SignService/SignService.csproj
    custom: msbuild
    arguments: '/p:Configuration=$(BuildConfiguration) /t:PrebuildScript'

- task: DotNetCoreCLI@2
  displayName: Build and Publish
  inputs:
    command: publish
    publishWebProjects: false
    projects: src/SignService/SignService.csproj
    arguments: '-c $(BuildConfiguration) --output $(build.artifactstagingdirectory)\website\'
    zipAfterPublish: True

- task: PublishBuildArtifacts@1
  displayName: Publish SignService Artifact
  inputs:
    pathToPublish: $(Build.ArtifactStagingDirectory)\website
    artifactType: container
    artifactName: SignService

trigger:
  branches:
    include:
      - master
      - rel/*
  paths:
    include:
      - src/SignService/*
      - scripts/Install-WindowsSdkISO.ps1
      - .editorconfig
      - azure-pipelines.server.yml
      - version.json

pr:
  branches:
    include:
      - master
      - rel/*
  paths:
    include:
      - src/SignService/*
      - scripts/Install-WindowsSdkISO.ps1
      - .editorconfig
      - azure-pipelines.server.yml
      - version.json

pool:
  vmImage: windows-2019

variables: 
  BuildConfiguration: Release
  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

steps:
- task: DotNetCoreInstaller@0
  inputs:
    version: '2.2.203'

- task: DotNetCoreCLI@2
  displayName: Copy sdk files locally before build
  inputs:
    command: custom
    projects: src/SignService/SignService.csproj
    custom: msbuild
    arguments: '/p:Configuration=$(BuildConfiguration) /t:PrebuildScript'

- task: DotNetCoreCLI@2
  displayName: Build and Publish
  inputs:
    command: publish
    publishWebProjects: false
    projects: src/SignService/SignService.csproj
    arguments: '-c $(BuildConfiguration) --output $(build.artifactstagingdirectory)\website\'
    zipAfterPublish: True

- task: PublishBuildArtifacts@1
  displayName: Publish SignService Artifact
  inputs:
    pathToPublish: $(Build.ArtifactStagingDirectory)\website
    artifactType: container
    artifactName: SignService

Use latest 2.2 sdk to build
Use latest 2.2 sdk to build
