Skip to content

Commit 59e873a

Browse files
authored
chore(ci): fix iOS builds hanging on Github Actions (#6854)
1 parent 0c1f9ca commit 59e873a

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
33
ruby '2.7.7'
44

55
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
6-
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
6+
gem 'cocoapods', '>= 1.13', '!= 1.15.1', '!= 1.15.0'
77
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
88
gem 'xcodeproj', '< 1.26.0'
99
gem 'concurrent-ruby', '< 1.3.4'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ DEPENDENCIES
308308
activesupport (>= 6.1.7.5, != 7.1.0)
309309
benchmark
310310
bigdecimal
311-
cocoapods (>= 1.13, != 1.15.0, != 1.15.1)
311+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
312312
concurrent-ruby (< 1.3.4)
313313
fastlane
314314
fastlane-plugin-bugsnag

ios/fastlane/Fastfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ platform :ios do
2121
create_keychain(
2222
name: ENV["MATCH_KEYCHAIN_NAME"],
2323
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
24-
timeout: 1200
24+
timeout: 0,
25+
lock_when_sleeps: false,
26+
unlock: true
2527
)
2628
end
2729

@@ -54,11 +56,16 @@ platform :ios do
5456
key_filepath: 'fastlane/app_store_connect_api_key.p8',
5557
in_house: false
5658
)
57-
match(type: "appstore")
58-
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.ShareExtension")
59-
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.NotificationService")
60-
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.watchkitapp")
59+
match(type: "appstore", platform: "ios")
60+
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.ShareExtension", platform: "ios")
61+
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.NotificationService", platform: "ios")
62+
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.watchkitapp", platform: "ios")
6163
# pem(api_key: api_key) # still uses Spaceship http://docs.fastlane.tools/actions/pem/#how-does-it-work
64+
# Allow codesign to access keys without prompting
65+
keychain_path = "~/Library/Keychains/#{ENV['MATCH_KEYCHAIN_NAME']}-db"
66+
sh "security unlock-keychain -p \"#{ENV['MATCH_KEYCHAIN_PASSWORD']}\" #{keychain_path}"
67+
sh "security set-keychain-settings -lut 3600 #{keychain_path}"
68+
sh "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k \"#{ENV['MATCH_KEYCHAIN_PASSWORD']}\" #{keychain_path}"
6269
gym(
6370
scheme: "RocketChatRN",
6471
workspace: "RocketChatRN.xcworkspace",
@@ -72,11 +79,18 @@ platform :ios do
7279

7380
match(
7481
type: "appstore",
82+
platform: "ios",
7583
app_identifier: ["chat.rocket.ios", "chat.rocket.ios.NotificationService", "chat.rocket.ios.Rocket-Chat-ShareExtension", "chat.rocket.ios.watchkitapp"],
7684
readonly: true,
7785
output_path: './'
7886
)
7987

88+
# Allow codesign to access keys without prompting
89+
keychain_path = "~/Library/Keychains/#{ENV['MATCH_KEYCHAIN_NAME']}-db"
90+
sh "security unlock-keychain -p \"#{ENV['MATCH_KEYCHAIN_PASSWORD']}\" #{keychain_path}"
91+
sh "security set-keychain-settings -lut 3600 #{keychain_path}"
92+
sh "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k \"#{ENV['MATCH_KEYCHAIN_PASSWORD']}\" #{keychain_path} || true"
93+
8094
update_code_signing_settings(
8195
profile_name: "match AppStore chat.rocket.ios.NotificationService",
8296
build_configurations: "Release",

0 commit comments

Comments
 (0)