-
Notifications
You must be signed in to change notification settings - Fork 164
/
azure-pipelines.yml
93 lines (90 loc) · 3.17 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
variables:
QT_FORMULAE: qt@5
REPO_SLUG: $(Build.Repository.Name)
CURRENT_COMMIT: $(Build.SourceVersion)
trigger:
branches:
include:
- main
- master
- staging/*
- ci-*
tags:
include:
- v*
pr:
branches:
include:
- main
- master
- 20*
stages:
- stage: Builds
jobs:
- job: macOSBuilds
strategy:
matrix:
macOS_13:
vmImage: 'macOS-13'
artifactName: 'macOS-13'
macOS_14:
vmImage: 'macOS-14'
artifactName: 'macOS-14'
pool:
vmImage: $[ variables['vmImage'] ]
steps:
- checkout: self
fetchDepth: 1
clean: true
- script: ./CI/appveyor/install_macos_deps.sh
displayName: '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)
./CI/appveyor/build_appveyor_macos.sh
displayName: 'Build'
workingDirectory: $(Build.Repository.LocalPath)
- script: ./CI/appveyor/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@0
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)'