mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Merge pull request #129 from YACReader/feature/azure-update
Update azure pipelines to work on forked repos
This commit is contained in:
commit
5688303999
@ -17,7 +17,7 @@ jobs:
|
|||||||
- script: |
|
- script: |
|
||||||
pip install aqtinstall
|
pip install aqtinstall
|
||||||
mkdir C:\Qt
|
mkdir C:\Qt
|
||||||
python -m aqt install -O c:\Qt ${{ parameters.qt_version }} windows desktop ${{ parameters.qt_aqt_spec }}
|
python -m aqt install -O c:\Qt ${{ parameters.qt_version }} windows desktop ${{ parameters.qt_aqt_spec }} -m qtscript
|
||||||
dir C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin
|
dir C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin
|
||||||
choco install -y wget
|
choco install -y wget
|
||||||
choco install innosetup
|
choco install innosetup
|
||||||
|
@ -3,6 +3,10 @@ trigger:
|
|||||||
- master
|
- master
|
||||||
- develop
|
- 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:
|
jobs:
|
||||||
- job: Initialization
|
- job: Initialization
|
||||||
pool:
|
pool:
|
||||||
@ -12,7 +16,7 @@ jobs:
|
|||||||
- job: CodeFormatValidation
|
- job: CodeFormatValidation
|
||||||
dependsOn: Initialization
|
dependsOn: Initialization
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'macOS-10.14'
|
vmImage: 'macOS-10.15'
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
brew install clang-format
|
brew install clang-format
|
||||||
@ -59,9 +63,10 @@ jobs:
|
|||||||
- job: MacOS
|
- job: MacOS
|
||||||
dependsOn: CodeFormatValidation
|
dependsOn: CodeFormatValidation
|
||||||
variables:
|
variables:
|
||||||
- group: macos-codesign
|
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
|
||||||
|
- group: macos-codesign
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'macOS-10.14'
|
vmImage: 'macOS-10.15'
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
brew install qt
|
brew install qt
|
||||||
@ -74,14 +79,16 @@ jobs:
|
|||||||
tar xjf $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02_src_all.tar.bz2 -C $(Build.SourcesDirectory)/compressed_archive
|
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
|
mv $(Build.SourcesDirectory)/compressed_archive/p7zip_16.02 $(Build.SourcesDirectory)/compressed_archive/libp7zip
|
||||||
displayName: 'Install dependencies'
|
displayName: 'Install dependencies'
|
||||||
- task: InstallAppleCertificate@2
|
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
|
||||||
inputs:
|
- task: InstallAppleCertificate@2
|
||||||
certSecureFile: 'developerID_application.p12'
|
inputs:
|
||||||
certPwd: $(P12Password)
|
certSecureFile: 'developerID_application.p12'
|
||||||
|
certPwd: $(P12Password)
|
||||||
- script: |
|
- script: |
|
||||||
cd $(Build.SourcesDirectory)
|
cd $(Build.SourcesDirectory)
|
||||||
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )"
|
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
|
./compileOSX.sh $VERSION $(Build.BuildNumber) $SKIP_CODESIGN
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
- task: CopyFiles@2
|
- task: CopyFiles@2
|
||||||
@ -112,60 +119,64 @@ jobs:
|
|||||||
vc_redist_url: 'https://go.microsoft.com/fwlink/?LinkId=746571'
|
vc_redist_url: 'https://go.microsoft.com/fwlink/?LinkId=746571'
|
||||||
vc_redist_file_name: 'vc_redist.x86.exe'
|
vc_redist_file_name: 'vc_redist.x86.exe'
|
||||||
vc_vars: 'vcvars32.bat'
|
vc_vars: 'vcvars32.bat'
|
||||||
- job: PublishDevBuilds
|
|
||||||
dependsOn:
|
- ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/') }}:
|
||||||
- Linux
|
- job: PublishDevBuilds
|
||||||
- MacOS
|
dependsOn:
|
||||||
- Windows_x86
|
- Linux
|
||||||
- Windows_x64
|
- MacOS
|
||||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
|
- Windows_x86
|
||||||
variables:
|
- Windows_x64
|
||||||
- group: bintray
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), true)
|
||||||
pool:
|
variables:
|
||||||
vmImage: 'ubuntu-16.04'
|
- group: bintray
|
||||||
steps:
|
pool:
|
||||||
|
vmImage: 'ubuntu-16.04'
|
||||||
|
steps:
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
inputs:
|
||||||
|
buildType: 'current'
|
||||||
|
targetPath: $(Build.SourcesDirectory)/dev_bin
|
||||||
|
- script: |
|
||||||
|
ls -lah $(Build.SourcesDirectory)/dev_bin/**/*.*
|
||||||
|
- task: cURLUploader@2
|
||||||
|
inputs:
|
||||||
|
files: '$(Build.SourcesDirectory)/dev_bin/**/*.*'
|
||||||
|
authType: 'userAndPass'
|
||||||
|
username: $(username)
|
||||||
|
password: $(api-key)
|
||||||
|
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
|
||||||
|
- MacOS
|
||||||
|
- Windows_x86
|
||||||
|
- Windows_x64
|
||||||
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
||||||
|
variables:
|
||||||
|
- group: github-releases
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-16.04'
|
||||||
|
steps:
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
targetPath: $(Build.SourcesDirectory)/dev_bin
|
targetPath: $(Build.ArtifactStagingDirectory)
|
||||||
- script: |
|
- script: |
|
||||||
ls -lah $(Build.SourcesDirectory)/dev_bin/**/*.*
|
find $(Build.ArtifactStagingDirectory) -name '*.*' -exec cp {} $(Build.ArtifactStagingDirectory) \;
|
||||||
- task: cURLUploader@2
|
displayName: 'flatten artifact staging directory'
|
||||||
|
- script: |
|
||||||
|
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )"
|
||||||
|
echo "##vso[task.setvariable variable=VERSION]$VERSION"
|
||||||
|
displayName: 'Version'
|
||||||
|
- task: GitHubRelease@0
|
||||||
inputs:
|
inputs:
|
||||||
files: '$(Build.SourcesDirectory)/dev_bin/**/*.*'
|
gitHubConnection: yacreader-releases
|
||||||
authType: 'userAndPass'
|
title: $(VERSION)
|
||||||
username: $(username)
|
tagSource: 'manual'
|
||||||
password: $(api-key)
|
tag: $(VERSION)
|
||||||
options: -H "X-Bintray-Publish:1"
|
addChangeLog: false
|
||||||
remotePath: ''
|
|
||||||
url: https://api.bintray.com/content/luisangelsm/YACReader/DevBuilds/$(Build.BuildNumber)/
|
|
||||||
- job: Release
|
|
||||||
dependsOn:
|
|
||||||
- Linux
|
|
||||||
- MacOS
|
|
||||||
- Windows_x86
|
|
||||||
- Windows_x64
|
|
||||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
||||||
variables:
|
|
||||||
- group: github-releases
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-16.04'
|
|
||||||
steps:
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
targetPath: $(Build.ArtifactStagingDirectory)
|
|
||||||
- script: |
|
|
||||||
find $(Build.ArtifactStagingDirectory) -name '*.*' -exec cp {} $(Build.ArtifactStagingDirectory) \;
|
|
||||||
displayName: 'flatten artifact staging directory'
|
|
||||||
- script: |
|
|
||||||
VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )"
|
|
||||||
echo "##vso[task.setvariable variable=VERSION]$VERSION"
|
|
||||||
displayName: 'Version'
|
|
||||||
- task: GitHubRelease@0
|
|
||||||
inputs:
|
|
||||||
gitHubConnection: yacreader-releases
|
|
||||||
title: $(VERSION)
|
|
||||||
tagSource: 'manual'
|
|
||||||
tag: $(VERSION)
|
|
||||||
addChangeLog: false
|
|
||||||
|
Loading…
Reference in New Issue
Block a user