# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.

trigger:
  branches:
    include:
    - main
    - hotfix/*
    - release/*
    - restapi*
  paths:
    include:
    - sdk/template/
    - scripts/
    # NOTE: DO NOT INCLUDE BELOW PATH WHEN COPYING THIS FILE
    # eng/common code changes trigger template pipeline for basic checking.
    - eng/common/

pr:
  branches:
    include:
    - main
    - feature/*
    - hotfix/*
    - release/*
    - restapi*
  paths:
    include:
    - sdk/template/
    # NOTE: DO NOT INCLUDE BELOW PATH WHEN COPYING THIS FILE
    # eng/common code changes trigger template pipeline for basic checking.
    - eng/common/

parameters:
  - name: ReleaseToDevOpsOnly
    displayName: 'Release package to DevOps feed instead of PyPi'
    type: boolean
    default: false
  - name: AutoApproveRelease
    displayName: 'Automatically approve the release stage'
    type: boolean
    default: false
  # Switch to canary to test canary 1es branch. 1es template validation will set this parameter
  # to canary on run.
  - name: oneESTemplateTag
    type: string
    default: release
    values:
      - release
      - canary

extends:
  template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
  parameters:
    ${{ if eq(parameters.ReleaseToDevOpsOnly, 'true') }}:
      PublicFeed: 'public/storage-staging'
    ${{ if eq(parameters.AutoApproveRelease, 'true') }}:
      PublicPublishEnvironment: none
    oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
    ServiceDirectory: template
    TestProxy: true
    Artifacts:
    - name: azure-template
      safeName: azuretemplate
