-
Notifications
You must be signed in to change notification settings - Fork 165
/
azure-pipelines.yml
99 lines (95 loc) · 3.32 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
variables:
QT_FORMULAE: qt@5
REPO_SLUG: $(Build.Repository.Name)
CURRENT_COMMIT: $(Build.SourceVersion)
trigger:
branches:
include:
- main
- master
- dev
- ci-*
tags:
include:
- v*
pr:
branches:
include:
- main
- master
- dev
- ci-*
stages:
- stage: Builds
jobs:
- job: macOSBuilds
strategy:
matrix:
macOS_13:
vmImage: 'macOS-13'
artifactName: 'macOS-13'
macOS_14:
vmImage: 'macOS-14'
artifactName: 'macOS-14'
macOS_15:
vmImage: 'macOS-15'
artifactName: 'macOS-15'
pool:
vmImage: $[ variables['vmImage'] ]
steps:
- checkout: self
fetchDepth: 1
clean: true
- script: ./ci/macOS/install_macos_deps.sh
displayName: 'Build and Install Dependencies'
workingDirectory: $(Build.Repository.LocalPath)
- script: |
export BUILD_HOST="$(vmImage)"
export ACCOUNT_NAME=`echo $REPO_SLUG | awk -F "/" '{print $1}'`
export PROJECT_NAME=`echo $REPO_SLUG | awk -F "/" '{print $2}'`
export USERNAME="azure-pipelines"
export BUILD_REPO_URL=$(Build.Repository.Uri)
export RUN_ID=$(Build.BuildId)
export RUN_NUMBER=$(Build.BuildNumber)
export JOB_ID=$(System.JobId)
export JOB_NAME=$(System.JobName)
export RUNNER_ARCH=$(Agent.OSArchitecture)
export MACOSX_DEPLOYMENT_TARGET=11.0
./ci/macOS/build_azure_macos.sh
displayName: 'Build Scopy'
workingDirectory: $(Build.Repository.LocalPath)
- script: ./ci/macOS/package_darwin.sh
displayName: 'Create Scopy.dmg'
workingDirectory: $(Build.Repository.LocalPath)
- script: cp -R staging ${BUILD_ARTIFACTSTAGINGDIRECTORY}
displayName: 'Copy Staging Dir'
workingDirectory: $(Build.Repository.LocalPath)
- script: |
echo "ACCOUNT_NAME = " ${ACCOUNT_NAME}
echo "PROJECT_NAME = " ${PROJECT_NAME}
MACOS_VERSION=$(/usr/libexec/PlistBuddy -c "Print:ProductVersion" /System/Library/CoreServices/SystemVersion.plist)
DEPLOY_FILE=Scopy-macos${MACOS_VERSION}-${CURRENT_COMMIT:0:7}.dmg
cp build/ScopyApp.zip ${BUILD_ARTIFACTSTAGINGDIRECTORY}
cp build/Scopy.dmg ${BUILD_ARTIFACTSTAGINGDIRECTORY}/${DEPLOY_FILE}
cd ${BUILD_ARTIFACTSTAGINGDIRECTORY}
tar czvf Scopy-macos${MACOS_VERSION}.tar.gz ${DEPLOY_FILE}
ls -la
displayName: 'Rename and copy artifact'
workingDirectory: $(Build.Repository.LocalPath)
- task: GithubRelease@1
displayName: 'Push to continuous release'
condition: and(succeeded(), and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
inputs:
githubConnection: scopy_continuous_release
repositoryName: $(Build.Repository.Name)
action: edit
tag: continous
assets: $(Build.ArtifactStagingDirectory)/Scopy*.tar.gz
assetUploadMode: replace
isPreRelease: true
addChangeLog: false
- task: PublishPipelineArtifact@1
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: '$(artifactName)'