-
Notifications
You must be signed in to change notification settings - Fork 6
/
bitrise.yml
193 lines (186 loc) · 6.87 KB
/
bitrise.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
format_version: '8'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ios
trigger_map:
- push_branch: "*"
workflow: screenshots
- pull_request_source_branch: "*"
workflow: primary
workflows:
deploy:
steps:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]: {}
title: Do anything with Script step
- [email protected]: {}
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
- export_method: "$BITRISE_EXPORT_METHOD"
- [email protected]: {}
- [email protected]: {}
primary:
steps:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]: {}
title: Do anything with Script step
- [email protected]: {}
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
- [email protected]: {}
- [email protected]: {}
screenshots:
steps:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- script@1:
title: Add missing simulators
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# Create the iPad Pro (12.9-inch) (2nd generation) simulator
xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-13-4"
- script@1:
title: Set up environment variables
inputs:
- content: |-
#!/bin/bash
set -ex
# Pull any arguments that may have been set from Slack slash commands and such
if [ ! -z "$API_CHARGEPOINT_LANGUAGE" ] ; then
envman add --key CHARGEPOINT_LANGUAGE --value "$API_CHARGEPOINT_LANGUAGE"
fi
if [ ! -z "$API_CHARGEPOINT_UIINTERFACESTYLE" ] ; then
envman add --key CHARGEPOINT_UIINTERFACESTYLE --value "$API_CHARGEPOINT_UIINTERFACESTYLE"
fi
if [ ! -z "$API_CHARGEPOINT_IOS_DEVICE" ] ; then
envman add --key CHARGEPOINT_IOS_DEVICE --value "$API_CHARGEPOINT_IOS_DEVICE"
fi
if [ ! -z "$API_CHARGEPOINT_IOS_DEVICE_LANGUAGE" ] ; then
envman add --key CHARGEPOINT_IOS_DEVICE_LANGUAGE --value "$API_CHARGEPOINT_IOS_DEVICE_LANGUAGE"
fi
if [ ! -z "$API_CHARGEPOINT_IOS_DEVICE_REGION" ] ; then
envman add --key CHARGEPOINT_IOS_DEVICE_REGION --value "$API_CHARGEPOINT_IOS_DEVICE_REGION"
fi
- script@1:
title: Disable hardware keyboard in Simulator
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
- script@1:
title: Modify Simulator language before launch
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# Modify the iOS Simulator language before launch
find ~/Library/Developer/CoreSimulator/Devices/* -type d -maxdepth 0 -exec /usr/libexec/PlistBuddy -c "Delete :AppleLanguages" -c "Add :AppleLanguages array" -c "Add :AppleLanguages:0 string $CHARGEPOINT_IOS_DEVICE_LANGUAGE" -c "Delete :AppleLocale" -c "Add :AppleLocale string $CHARGEPOINT_IOS_DEVICE_REGION" {}/data/Library/Preferences/.GlobalPreferences.plist \;
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# Works on device & Simulator (affects only app) - Set the app's Info.plist to the style we want
#/usr/libexec/PlistBuddy -c 'Add :UIUserInterfaceStyle string "$CHARGEPOINT_UIINTERFACESTYLE"' bitrise-screenshot-automation/Info.plist
# Works on Simulator (affects whole device) - Modifies a system plist directly to work on Xcode 11.0 to Xcode 11.3
if [ "$CHARGEPOINT_UIINTERFACESTYLE" = "Dark" ]
then
echo "Setting Dark mode"
style=2
elif [ "$CHARGEPOINT_UIINTERFACESTYLE" = "Light" ]
then
echo "Setting Light mode"
style=1
fi
find ~/Library/Developer/CoreSimulator/Devices/* -type d -maxdepth 0 -exec /usr/libexec/PlistBuddy -c "Delete :UserInterfaceStyleMode" -c "Add :UserInterfaceStyleMode integer $style" {}/data/Library/Preferences/com.apple.uikitservices.userInterfaceStyleMode.plist \;
title: Set UIUserInterfaceStyle
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
- export_uitest_artifacts: 'true'
- generate_code_coverage_files: 'yes'
- verbose: 'yes'
- is_clean_build: 'yes'
- xcodebuild_test_options: "-derivedDataPath derivedData -testPlan 'Screenshots'"
- headless_mode: 'no'
- simulator_device: "$CHARGEPOINT_IOS_DEVICE"
- xcparse@0:
inputs:
- screenshots_divide_by_language: 'yes'
- screenshots_divide_by_test: 'yes'
- screenshots_divide_by_region: 'yes'
is_always_run: true
- create-zip@0:
title: Attach xcresult as ZIP to Deploy
inputs:
- destination: "$BITRISE_DEPLOY_DIR"
- source_path: "$BITRISE_XCRESULT_PATH"
is_always_run: true
- [email protected]: {}
envs:
- opts:
is_expand: false
CHARGEPOINT_IOS_DEVICE_LANGUAGE: ko-KR
- opts:
is_expand: false
CHARGEPOINT_IOS_DEVICE_REGION: ko-Kore_KR
meta:
bitrise.io:
stack: osx-xcode-11.4.x
app:
envs:
- opts:
is_expand: false
BITRISE_PROJECT_PATH: bitrise-screenshot-automation.xcodeproj
- opts:
is_expand: false
BITRISE_SCHEME: bitrise-screenshot-automation
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: development
- opts:
is_expand: false
CHARGEPOINT_IOS_DEVICE: iPhone 11 Pro Max
- opts:
is_expand: false
CHARGEPOINT_IOS_DEVICE_LANGUAGE: en
- opts:
is_expand: false
CHARGEPOINT_IOS_DEVICE_REGION: en_US
- opts:
is_expand: false
CHARGEPOINT_UIINTERFACESTYLE: Dark
- opts:
is_expand: false
CHARGEPOINT_LANGUAGE: en