parameters:
  GitHubRepo: $(Build.Repository.Name)
  Workspace: $(Pipeline.Workspace)
  ArtifactName: not-set
  VcpkgPortName: not-set
  DisplayNameExtension: 
  DailyReleaseRef: 
  DailyRelease: false

steps:
  - task: Powershell@2
    inputs:
      filePath: eng/scripts/Initialize-VcpkgRelease.ps1
      arguments: >-
        -GitHubRepo "${{ parameters.GitHubRepo }}"
        -PackageSpecPath ${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}/package-info.json
        -SourceDirectory ${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}/vcpkg
        -DailyReleaseRef '${{ parameters.DailyReleaseRef }}'
        -Verbose
      pwsh: true
    displayName: Initialize vcpkg release ${{ parameters.DisplayNameExtension }}

  - task: Powershell@2
    inputs:
      pwsh: true
      targetType: filePath
      filePath: eng/scripts/Update-VcpkgPort.ps1
      arguments: >-
        -ReleaseArtifactSourceDirectory "${{ parameters.Workspace }}/packages/${{ parameters.ArtifactName }}"
        -PortDestinationDirectory 'ports/${{ parameters.VcpkgPortName }}'
        -VcpkgPortName '${{ parameters.VcpkgPortName }}'
        -GitCommitParameters '-c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com"'
        -DailyRelease:$${{ parameters.DailyRelease }}
      workingDirectory: ${{ parameters.Workspace }}/vcpkg
    displayName: Update vcpkg port ${{ parameters.DisplayNameExtension }}