# External variables:
# ProjectFile - The project to build and test. This variable is defined in pipeline web ui because we want to be able to provide it at queue time and that isn't supported in yaml yet.
# VersioningProps - A collection of extra msbuild versioning properties like OfficialBuildId, PreReleaseVersionLabel, and DotNetFinalVersionKind

trigger:
  - master

variables:
  DotNetCoreVersion: '2.1.503'
  ProjectFile: mgmtci.proj

jobs:
  - job: 'Build'

    pool:
      vmImage: 'vs2017-win2016'

    steps:
      - task: DotNetCoreInstaller@0
        displayName: 'Use .NET Core sdk $(DotNetCoreVersion)'
        inputs:
          version: '$(DotNetCoreVersion)'

      - script: 'dotnet pack $(ProjectFile) -o $(Build.ArtifactStagingDirectory) -warnaserror $(VersioningProps)'
        displayName: 'Build and Package'
        env:
          DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
          DOTNET_CLI_TELEMETRY_OPTOUT: 1
          DOTNET_MULTILEVEL_LOOKUP: 0

      - task: PublishBuildArtifacts@1
        condition: succeededOrFailed()
        displayName: 'Publish Artifacts'
        inputs:
          ArtifactName: packages

# External variables:
# ProjectFile - The project to build and test. This variable is defined in pipeline web ui because we want to be able to provide it at queue time and that isn't supported in yaml yet.
# VersioningProps - A collection of extra msbuild versioning properties like OfficialBuildId, PreReleaseVersionLabel, and DotNetFinalVersionKind

trigger:
  - master

resources:
  repositories:
    - repository: azure-sdk-build-tools
      type: git
      name: internal/azure-sdk-build-tools

variables:
  DotNetCoreVersion: '2.1.503'
  ProjectFile: mgmtci.proj
  BlobFeedUrl: https://azuresdkartifacts.blob.core.windows.net/azure-sdk-tools/index.json

stages:
  - stage: Build
    jobs:
      - job: 'Build'

        pool:
          vmImage: 'vs2017-win2016'

        steps:
          - task: DotNetCoreInstaller@0
            displayName: 'Use .NET Core sdk $(DotNetCoreVersion)'
            inputs:
              version: '$(DotNetCoreVersion)'

          - script: 'dotnet pack $(ProjectFile) -o $(Build.ArtifactStagingDirectory) -warnaserror $(VersioningProps)'
            displayName: 'Build and Package'
            env:
              DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
              DOTNET_CLI_TELEMETRY_OPTOUT: 1
              DOTNET_MULTILEVEL_LOOKUP: 0

          - task: PublishBuildArtifacts@1
            condition: succeededOrFailed()
            displayName: 'Publish Artifacts'
            inputs:
              ArtifactName: packages
  - ${{ if ne(variables['System.TeamProject'], 'Public') }}:
    - template: pipelines/stages/net-release-blobfeed.yml@azure-sdk-build-tools
      parameters:
        ShouldSign: false

Add release stage to the mgmt pipeline
Add release stage to the mgmt pipeline
