# Create UPM packages for public OFFICIAL release

variables:
- template: config/settings.yml

parameters:
- name: SourcePipeline
  type: string
  default: stabilization_ci
  values:
    - stabilization_ci
    - mrtk_ci
- name: PreviewNumber
  type: number
  default: -1

jobs:
- job: UPMPublicRelease
  timeoutInMinutes: 30
  pool:
    vmImage: windows-2019
  steps:
  - task: DownloadPipelineArtifact@2
    displayName: Download tarballs
    inputs:
      source: specific
      project: $(System.TeamProjectId)
      ${{ if eq(parameters.SourcePipeline, 'stabilization_ci') }}:
        pipeline: 32
      ${{ if eq(parameters.SourcePipeline, 'mrtk_ci') }}:
        pipeline: 15
        runVersion: latestFromBranch
        runBranch: refs/heads/releases/$(MRTKVersion)
      artifactName: mrtk-upm
      path: $(Agent.TempDirectory)

  - template: templates/tasks/pack-upm.yml
    parameters:
      ${{ if ge(parameters.PreviewNumber, 0) }}:
        previewNumber: ${{ parameters.PreviewNumber }}
      ${{ if lt(parameters.PreviewNumber, 0) }}:
        previewNumber: ""
      projectRoot: $(Agent.TempDirectory)
      repack: true

# Create UPM packages for public OFFICIAL release

variables:
- template: config/settings.yml

parameters:
- name: SourcePipeline
  type: string
  default: stabilization_ci
  values:
    - stabilization_ci
    - mrtk_ci
- name: PreviewNumber
  type: number
  default: -1

jobs:
- job: UPMPublicRelease
  timeoutInMinutes: 30
  pool:
    vmImage: windows-2019
  steps:
  - task: DownloadPipelineArtifact@2
    displayName: Download tarballs
    inputs:
      source: specific
      project: $(System.TeamProjectId)
      ${{ if eq(parameters.SourcePipeline, 'stabilization_ci') }}:
        pipeline: 32
      ${{ if eq(parameters.SourcePipeline, 'mrtk_ci') }}:
        pipeline: 15
      runVersion: latestFromBranch
      runBranch: $(Build.SourceBranch)
      artifactName: mrtk-upm
      path: $(Agent.TempDirectory)

  - template: templates/tasks/pack-upm.yml
    parameters:
      ${{ if ge(parameters.PreviewNumber, 0) }}:
        previewNumber: ${{ parameters.PreviewNumber }}
      ${{ if lt(parameters.PreviewNumber, 0) }}:
        previewNumber: ""
      projectRoot: $(Agent.TempDirectory)
      repack: true

Use the current branch for all runs of this pipeline
Use the current branch for all runs of this pipeline
