-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
110 lines (106 loc) · 3.28 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
100
101
102
103
104
105
106
107
108
109
110
# NOTES
#
# In the Azure DevOps Web IDE:
# 1) Set the following pipeline variables:
# - AzureStorageAccountName
# - AzureSubscriptionID
# 2) In the project settings you must create a `service connection` of type `Azure Resource Manager`
# call it `SomethingServiceConnection` and reference by name in in the AzureCLI tasks
# `connectedServiceNameARM` input.
#
# These will be used by the AzureCLI@2 to copy the build artifact(s) to an Azure blob storage for easy
# downloading or further processing.
#
# For build numbering you can use the following options:
# BUILD_BUILDID = NN # Linier build number eg. 87, 88, 89
# Build.BuildNumber = NN # Linier daily build number eg. 1, 2, 3
# Build.BuildId = YYYYMMDD.NN # Build identifier eg. 20190515.3, 20190516.1
#
# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode
#
trigger:
- master
pool:
vmImage: 'macos-latest'
variables:
- group: CertsAndKeys
- name: 'ProfileFileName'
value: 'Invasive_Species.mobileprovision'
- name: 'ProfileUUID'
value: 'c47e48d4-da1f-4690-b069-81785adc2af1'
- name: 'CertificateFileName'
value: 'itunes-store.p12'
- name: 'WorkspacePath'
value: '**/ipad.xcworkspace'
- name: 'SchemaName'
value: 'ipad'
- name: 'ExportOptionsFileName'
value: 'options.plist'
- name: 'ExportMethod'
value: 'app-store'
# Variables below are used for ITC uploads
- name: 'BundleID'
value: 'ca.bc.gov.InvasivesBC'
- name: 'AppStoreServiceConnectionName'
value: 'BCDevX'
- name: 'ITCTeamID'
value: 908186
steps:
- task: InstallAppleCertificate@2
inputs:
certSecureFile: $(CertificateFileName)
certPwd: '$(P12password)'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: $(ProfileFileName)
removeProfile: true
- task: CmdLine@2
displayName: Bump build number
timeoutInMinutes: 1
inputs:
script: |
./scripts/az-set-build-no.sh $(SchemaName) # SchemaName matches the target.
- task: CmdLine@2
displayName: Update CocaPods
timeoutInMinutes: 3
inputs:
script: |
gem install cocoapods
- task: CocoaPods@0
timeoutInMinutes: 10
inputs:
forceRepoUpdate: false
- task: Xcode@5
displayName: Build
timeoutInMinutes: 45
inputs:
actions: 'archive' # build, clean, test, analyze, and archive
scheme: $(SchemaName)
sdk: 'iphoneos'
configuration: 'Release'
xcWorkspacePath: $(WorkspacePath)
xcodeVersion: 'default'
packageApp: true
signingOption: 'default'
provisioningProfileUuid: $(ProfileUUID)
exportMethod: $(ExportMethod)
exportOptions: 'plist'
exportOptionsPlist: $(ExportOptionsFileName)
archivePath: '$(Build.ArtifactStagingDirectory)/pack'
args: '-xcconfig release.xcconfig'
- task: AppStoreRelease@1
timeoutInMinutes: 25
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
serviceEndpoint: $(AppStoreServiceConnectionName)
appIdentifier: $(BundleID)
appType: 'iOS'
ipaPath: '**/*.ipa'
releaseTrack: 'TestFlight'
shouldSkipWaitingForProcessing: true # don't wait
shouldSkipSubmission: true # don't auto send to testers
env:
FASTLANE_ITC_TEAM_ID: $(ITCTeamID)