trigger: none
pr: none

variables:
  OpenSSLVersion: '1.0.2u'
  MacOSXDeploymentTarget: '10.9'

jobs:
  - job: 'OpenSSL'

    pool:
      vmImage: 'macOS-10.15'

    steps:
      - script: sudo xcode-select --switch /Applications/Xcode_11.3.1.app
        displayName: 'Select Xcode 11.3.1'

      - script: source ./build_openssl_osx.sh
        displayName: 'Build OpenSSL'
        env:
          CFLAGS: -mmacosx-version-min=$(MacOSXDeploymentTarget)
          DEST: $(Build.ArtifactStagingDirectory)
          LDFLAGS: -mmacosx-version-min=$(MacOSXDeploymentTarget)
          MACOSX_DEPLOYMENT_TARGET: $(MacOSXDeploymentTarget)
          OPENSSL_VERSION: $(OpenSSLVersion)

      - task: PublishPipelineArtifact@0
        displayName: 'Publish OpenSSL artifact'
        inputs:
          artifactName: openssl-macosx$(MacOSXDeploymentTarget)
          targetPath: $(Build.ArtifactStagingDirectory)/openssl
