parameters:
  pool: 'Hosted VS2017'
  jobName: 'win_packaging'
  parentJobs: []

jobs:
- job: ${{ parameters.jobName }}
  dependsOn:
      ${{ parameters.parentJobs }}
  pool:
    name: ${{ parameters.pool }}

  displayName: Windows Packaging

  steps:
  - powershell: |
      Get-ChildItem -Path env:
    displayName: Capture environment
    condition: succeededOrFailed()

  - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml

  - powershell: |
      [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
      Import-Module .\tools\ci.psm1
      Invoke-CIInstall
    displayName: Bootstrap
    condition: succeededOrFailed()

  - powershell: |
      Import-Module .\tools\ci.psm1
      New-CodeCoverageAndTestPackage
      Invoke-CIFinish -NuGetKey $(NUGET_KEY)
    displayName: Build and Test Package
