jobs:
  - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
    - template: /eng/build-pr.yml
      parameters:
        agentOs: Windows_NT_TemplateEngine
        pool:
          ${{ if eq(variables['System.TeamProject'], 'public') }}:
            name: $(DncEngPublicBuildPool)
            demands: ImageOverride -equals windows.vs2022preview.amd64.open
          ${{ if ne(variables['System.TeamProject'], 'public') }}:
            name: $(DncEngInternalBuildPool)
            demands: ImageOverride -equals windows.vs2022preview.amd64
        ${{ if eq(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
        ${{ if ne(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: Windows.Amd64.VS2022.Pre
        strategy:
          matrix:
            Build_Release:
              _BuildConfig: Release
              _PublishArgs: '-publish /p:DotNetPublishUsingPipelines=true'
              _SignType: test
              _Test: -test

    - template: /eng/build-pr.yml
      parameters:
        agentOs: Ubuntu_22_04_TemplateEngine
        pool:
          ${{ if eq(variables['System.TeamProject'], 'public') }}:
            name: $(DncEngPublicBuildPool)
            demands: ImageOverride -equals build.ubuntu.2204.amd64.open
          ${{ if ne(variables['System.TeamProject'], 'public') }}:
            name: $(DncEngInternalBuildPool)
            demands: ImageOverride -equals build.ubuntu.2204.amd64
        ${{ if eq(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: 'ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64'
        ${{ if ne(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: Ubuntu.2204.Amd64
        strategy:
          matrix:
            Build_Release:
              _BuildConfig: Release
              _PublishArgs: ''
              _SignType: test
              _Test: -test

    - template: /eng/build-pr.yml
      parameters:
        agentOs: Darwin_TemplateEngine
        pool:
          vmImage: 'macOS-latest'
        ${{ if eq(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: OSX.1100.Amd64.Open
        ${{ if ne(variables['System.TeamProject'], 'public') }}:
          helixTargetQueue: OSX.1100.Amd64
        strategy:
          matrix:
            Build_Release:
              _BuildConfig: Release
              _PublishArgs: ''
              _SignType: test
              _Test: -test