Update azure pipelines to work on forked repos

Use macos catalina too
This commit is contained in:
Luis Ángel San Martín 2020-04-09 18:17:17 +02:00
parent 15c126fda5
commit 7e19dc8e6a

View File

@ -3,6 +3,10 @@ trigger:
- master
- develop
variables:
is_original_repo: ${{ eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}
is_fork: ${{ not(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/')) }}
jobs:
- job: Initialization
pool:
@ -12,7 +16,7 @@ jobs:
- job: CodeFormatValidation
dependsOn: Initialization
pool:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
steps:
- script: |
brew install clang-format
@ -59,9 +63,10 @@ jobs:
- job: MacOS
dependsOn: CodeFormatValidation
variables:
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
- group: macos-codesign
pool:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
steps:
- script: |
brew install qt
@ -74,6 +79,7 @@ jobs:
tar xjf $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02_src_all.tar.bz2 -C $(Build.SourcesDirectory)/compressed_archive
mv $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02 $(Build.SourcesDirectory)/compressed_archive/libp7zip
displayName: 'Install dependencies'
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'developerID_application.p12'
@ -81,7 +87,8 @@ jobs:
- script: |
cd $(Build.SourcesDirectory)
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )"
SKIP_CODESIGN="$(tr [A-Z] [a-z] <<< "$(System.PullRequest.IsFork)")"
echo "Trying to know if we are in a forked repo: $IS_FORK"
SKIP_CODESIGN="$(tr [A-Z] [a-z] <<< "$IS_FORK")"
./compileOSX.sh $VERSION $(Build.BuildNumber) $SKIP_CODESIGN
displayName: 'Build'
- task: CopyFiles@2
@ -112,13 +119,15 @@ jobs:
vc_redist_url: 'https://go.microsoft.com/fwlink/?LinkId=746571'
vc_redist_file_name: 'vc_redist.x86.exe'
vc_vars: 'vcvars32.bat'
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
- job: PublishDevBuilds
dependsOn:
- Linux
- MacOS
- Windows_x86
- Windows_x64
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), true)
variables:
- group: bintray
pool:
@ -139,6 +148,8 @@ jobs:
options: -H "X-Bintray-Publish:1"
remotePath: ''
url: https://api.bintray.com/content/luisangelsm/YACReader/DevBuilds/$(Build.BuildNumber)/
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
- job: Release
dependsOn:
- Linux