Skip to content

Commit 613d747

Browse files
chore: Add Context Values
1 parent c606a38 commit 613d747

File tree

5 files changed

+142
-45
lines changed

5 files changed

+142
-45
lines changed

.circleci/config.yml

+78-2
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ commands:
6060
steps:
6161
- checkout
6262
- setup
63+
- setup-certificates
6364
- run:
6465
name: Unit Tests
6566
command: bundle exec fastlane unit_tests test_plan:<< parameters.test_plan >>
6667
- store_scan_artifacts
6768
- store_test_output
6869
- store_scan_results
70+
- cleanup-signing
6971

7072
integration_tests:
7173
parameters:
@@ -133,17 +135,67 @@ commands:
133135
root: ~/Desktop
134136
paths:
135137
- SizeImpact.md
138+
139+
setup-certificates:
140+
steps:
141+
- run:
142+
name: Setup Certificate and Keychain
143+
command: |
144+
# create variables
145+
CERTIFICATE_PATH=$HOME/build_certificate.p12
146+
KEYCHAIN_PATH=$HOME/app-signing.keychain-db
147+
148+
# import certificate from CircleCI context
149+
echo -n "$VERIFY_DEMO_CERT" | base64 --decode -o $CERTIFICATE_PATH
150+
151+
# create temporary keychain
152+
security create-keychain -p "$KEYCHAIN_PASS" $KEYCHAIN_PATH
153+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
154+
security unlock-keychain -p "$KEYCHAIN_PASS" $KEYCHAIN_PATH
155+
156+
# import certificate to keychain
157+
security import $CERTIFICATE_PATH -P "$VERIFY_DEMO_CERT_PASS" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
158+
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASS" $KEYCHAIN_PATH
159+
security list-keychain -d user -s $KEYCHAIN_PATH
160+
- run:
161+
name: Setup Provisioning Profiles
162+
command: |
163+
setup_provisioning_profile() {
164+
local profile_var=$1
165+
local profile_path="$HOME/profile_$(basename "$profile_var").mobileprovision"
166+
167+
# decode and save the provisioning profile
168+
echo -n "${!profile_var}" | base64 --decode -o "$profile_path"
169+
170+
# create profiles directory if it doesn't exist
171+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
172+
173+
# copy the profile to the correct location
174+
cp "$profile_path" ~/Library/MobileDevice/Provisioning\ Profiles/
175+
}
176+
setup_provisioning_profile "VERIFY_DEMO_PROFILE"
177+
setup_provisioning_profile "HOST_APP_PROFILE"
178+
setup_provisioning_profile "APP_SIZER_PROFILE"
179+
cleanup-signing:
180+
steps:
181+
- run:
182+
name: Clean Up Keychain and Provisioning Profile
183+
command: |
184+
security delete-keychain $HOME/app-signing.keychain-db || true
185+
rm -f ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision || true
136186
137187
release:
138188
steps:
139189
- checkout
140190
- setup
191+
- setup-certificates
141192
- attach_workspace:
142193
at: ~/Desktop
143194
- configure_gcloud_app_distribution_service
144195
- run:
145196
name: "Release SDK"
146197
command: bundle exec fastlane release
198+
- cleanup-signing
147199

148200
distribute_debug_sample_app:
149201
parameters:
@@ -154,15 +206,18 @@ commands:
154206
description: API base URL
155207
type: string
156208
steps:
209+
- setup-certificates
157210
- run:
158211
name: Generating APK for internal distribution
159212
command: bundle exec fastlane distribute_debug_sample_app env:<<parameters.env>> url:<<parameters.base_url>>
213+
- cleanup-signing
160214
jobs:
161215
Distribute debug sample app:
162216
executor: macos_executor
163217
steps:
164218
- checkout
165219
- setup
220+
- setup-certificates
166221
- configure_gcloud_app_distribution_service
167222
- distribute_debug_sample_app:
168223
env: "DEV"
@@ -173,6 +228,7 @@ jobs:
173228
- distribute_debug_sample_app:
174229
env: "PROD"
175230
base_url: $PROD_URL
231+
- cleanup-signing
176232

177233
Unit Tests and Lint:
178234
executor: macos_executor
@@ -183,15 +239,19 @@ jobs:
183239
Integration Tests Single Device:
184240
executor: macos_executor
185241
steps:
242+
- setup-certificates
186243
- integration_tests:
187244
test_plan: IntegrationSuite
245+
- cleanup-signing
188246

189247
Integration Tests All Devices:
190248
executor: macos_executor
191249
steps:
250+
- setup-certificates
192251
- integration_tests:
193252
test_plan: IntegrationSuite
194253
ftl_devices: all
254+
- cleanup-signing
195255

196256
TwilioVerifyDemo Unit Tests:
197257
executor: macos_executor
@@ -209,7 +269,9 @@ jobs:
209269
Size report:
210270
executor: macos_executor
211271
steps:
272+
- setup-certificates
212273
- build_app_sizer
274+
- cleanup-signing
213275
Release SDK:
214276
executor: macos_executor
215277
steps:
@@ -218,21 +280,33 @@ jobs:
218280
workflows:
219281
build_and_test:
220282
jobs:
221-
- Unit Tests and Lint
283+
- Unit Tests and Lint:
284+
context:
285+
- verify-push-ios
222286
- Integration Tests Single Device:
287+
context:
288+
- verify-push-ios
223289
requires:
224290
- Unit Tests and Lint
225291
- Integration Tests All Devices:
292+
context:
293+
- verify-push-ios
226294
requires:
227295
- Integration Tests Single Device
228296
- Build TwilioVerify:
297+
context:
298+
- verify-push-ios
229299
requires:
230300
- Integration Tests Single Device
231301
- Unit Tests and Lint
232302
- Size report:
303+
context:
304+
- verify-push-ios
233305
requires:
234306
- Build TwilioVerify
235307
- Distribute debug sample app:
308+
context:
309+
- verify-push-ios
236310
requires:
237311
- Build TwilioVerify
238312
filters:
@@ -241,8 +315,10 @@ workflows:
241315
- /feature.*/
242316
- /release.*/
243317
- /hotfix.*/
244-
- dev
318+
- dev
245319
- Release SDK:
320+
context:
321+
- verify-push-ios
246322
requires:
247323
- Size report
248324
filters:

Gemfile.lock

+18-16
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ GEM
2323
minitest (>= 5.1)
2424
tzinfo (~> 2.0)
2525
zeitwerk (~> 2.3)
26-
addressable (2.8.6)
27-
public_suffix (>= 2.0.2, < 6.0)
26+
addressable (2.8.7)
27+
public_suffix (>= 2.0.2, < 7.0)
2828
algoliasearch (1.27.5)
2929
httpclient (~> 2.8, >= 2.8.3)
3030
json (>= 1.5.1)
@@ -116,12 +116,12 @@ GEM
116116
danger-slather (0.0.6)
117117
danger-plugin-api (~> 1.0)
118118
slather (~> 2.3)
119-
danger-swiftlint (0.35.0)
119+
danger-swiftlint (0.37.0)
120120
danger
121121
rake (> 10)
122122
thor (~> 1.0.0)
123123
declarative (0.0.20)
124-
digest-crc (0.6.5)
124+
digest-crc (0.7.0)
125125
rake (>= 12.0.0, < 14.0.0)
126126
domain_name (0.6.20240107)
127127
dotenv (2.8.1)
@@ -130,7 +130,7 @@ GEM
130130
ethon (0.16.0)
131131
ffi (>= 1.15.0)
132132
excon (0.110.0)
133-
faraday (1.10.3)
133+
faraday (1.10.4)
134134
faraday-em_http (~> 1.0)
135135
faraday-em_synchrony (~> 1.0)
136136
faraday-excon (~> 1.1)
@@ -151,9 +151,9 @@ GEM
151151
faraday-http-cache (2.5.1)
152152
faraday (>= 0.8)
153153
faraday-httpclient (1.0.1)
154-
faraday-multipart (1.0.4)
155-
multipart-post (~> 2)
156-
faraday-net_http (1.0.1)
154+
faraday-multipart (1.1.0)
155+
multipart-post (~> 2.0)
156+
faraday-net_http (1.0.2)
157157
faraday-net_http_persistent (1.2.0)
158158
faraday-patron (1.0.0)
159159
faraday-rack (1.0.0)
@@ -203,7 +203,7 @@ GEM
203203
xcpretty (~> 0.3.0)
204204
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
205205
fastlane-plugin-create_xcframework (1.1.2)
206-
fastlane-plugin-firebase_app_distribution (0.9.1)
206+
fastlane-plugin-firebase_app_distribution (0.10.0)
207207
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
208208
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
209209
fastlane-plugin-semantic_convention_release (1.0.6)
@@ -235,7 +235,7 @@ GEM
235235
google-apis-core (>= 0.11.0, < 2.a)
236236
google-apis-storage_v1 (0.31.0)
237237
google-apis-core (>= 0.11.0, < 2.a)
238-
google-cloud-core (1.7.0)
238+
google-cloud-core (1.7.1)
239239
google-cloud-env (>= 1.0, < 3.a)
240240
google-cloud-errors (~> 1.0)
241241
google-cloud-env (1.6.0)
@@ -273,7 +273,7 @@ GEM
273273
xcinvoke (~> 0.3.0)
274274
jmespath (1.6.2)
275275
json (2.7.2)
276-
jwt (2.8.1)
276+
jwt (2.10.1)
277277
base64
278278
kramdown (2.4.0)
279279
rexml
@@ -285,7 +285,7 @@ GEM
285285
minitest (5.22.3)
286286
molinillo (0.8.0)
287287
multi_json (1.15.0)
288-
multipart-post (2.4.0)
288+
multipart-post (2.4.1)
289289
mustache (1.1.1)
290290
nanaimo (0.3.0)
291291
nap (1.1.0)
@@ -302,7 +302,7 @@ GEM
302302
open4 (1.3.4)
303303
optparse (0.5.0)
304304
os (1.1.4)
305-
plist (3.7.1)
305+
plist (3.7.2)
306306
public_suffix (4.0.7)
307307
racc (1.7.3)
308308
rake (13.2.1)
@@ -314,11 +314,12 @@ GEM
314314
trailblazer-option (>= 0.1.1, < 0.2.0)
315315
uber (< 0.2.0)
316316
retriable (3.1.2)
317-
rexml (3.2.6)
317+
rexml (3.2.9)
318+
strscan
318319
rouge (2.0.7)
319320
ruby-macho (2.5.1)
320321
ruby2_keywords (0.0.5)
321-
rubyzip (2.3.2)
322+
rubyzip (2.4.1)
322323
sassc (2.4.0)
323324
ffi (~> 1.9)
324325
sawyer (0.9.2)
@@ -340,6 +341,7 @@ GEM
340341
nokogiri (>= 1.14.3)
341342
xcodeproj (~> 1.21)
342343
sqlite3 (1.7.3-arm64-darwin)
344+
strscan (3.1.2)
343345
terminal-notifier (2.0.0)
344346
terminal-table (3.0.2)
345347
unicode-display_width (>= 1.1.1, < 3)
@@ -378,7 +380,7 @@ DEPENDENCIES
378380
cocoapods (= 1.11.3)
379381
danger (>= 8.2.3)
380382
danger-slather (>= 0.0.6)
381-
danger-swiftlint (>= 0.24.4)
383+
danger-swiftlint (>= 0.36.0)
382384
fastlane (>= 2.216.0)
383385
fastlane-plugin-create_xcframework
384386
fastlane-plugin-firebase_app_distribution

TwilioVerifyDemo/TwilioVerifyDemo.xcodeproj/project.pbxproj

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 52;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -652,8 +652,9 @@
652652
buildSettings = {
653653
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
654654
BUNDLE_LOADER = "$(TEST_HOST)";
655-
CODE_SIGN_STYLE = Automatic;
656-
DEVELOPMENT_TEAM = 9EVH78F4V4;
655+
CODE_SIGN_IDENTITY = "";
656+
CODE_SIGN_STYLE = Manual;
657+
DEVELOPMENT_TEAM = "";
657658
INFOPLIST_FILE = TwilioVerifyDemoTests/Info.plist;
658659
LD_RUNPATH_SEARCH_PATHS = (
659660
"$(inherited)",
@@ -662,6 +663,7 @@
662663
);
663664
PRODUCT_BUNDLE_IDENTIFIER = com.twilio.TwilioVerifyDemoTests;
664665
PRODUCT_NAME = "$(TARGET_NAME)";
666+
PROVISIONING_PROFILE_SPECIFIER = "";
665667
SWIFT_VERSION = 5.0;
666668
TARGETED_DEVICE_FAMILY = "1,2";
667669
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TwilioVerifyDemo.app/TwilioVerifyDemo";
@@ -673,8 +675,9 @@
673675
buildSettings = {
674676
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
675677
BUNDLE_LOADER = "$(TEST_HOST)";
676-
CODE_SIGN_STYLE = Automatic;
677-
DEVELOPMENT_TEAM = 9EVH78F4V4;
678+
CODE_SIGN_IDENTITY = "";
679+
CODE_SIGN_STYLE = Manual;
680+
DEVELOPMENT_TEAM = "";
678681
INFOPLIST_FILE = TwilioVerifyDemoTests/Info.plist;
679682
LD_RUNPATH_SEARCH_PATHS = (
680683
"$(inherited)",
@@ -683,6 +686,7 @@
683686
);
684687
PRODUCT_BUNDLE_IDENTIFIER = com.twilio.TwilioVerifyDemoTests;
685688
PRODUCT_NAME = "$(TARGET_NAME)";
689+
PROVISIONING_PROFILE_SPECIFIER = "";
686690
SWIFT_VERSION = 5.0;
687691
TARGETED_DEVICE_FAMILY = "1,2";
688692
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TwilioVerifyDemo.app/TwilioVerifyDemo";

0 commit comments

Comments
 (0)