Target login keychain path for CI signing
Some checks failed
TestFlight / testflight (push) Failing after 19s
Some checks failed
TestFlight / testflight (push) Failing after 19s
This commit is contained in:
@@ -31,25 +31,36 @@ def release_version
|
||||
version
|
||||
end
|
||||
|
||||
def ci_login_keychain_path
|
||||
[
|
||||
File.expand_path("~/Library/Keychains/login.keychain-db"),
|
||||
File.expand_path("~/Library/Keychains/login.keychain")
|
||||
].find { |path| File.file?(path) } || "login.keychain"
|
||||
end
|
||||
|
||||
platform :ios do
|
||||
private_lane :cleanup_ci_signing_identity do
|
||||
next unless ENV["CI"]
|
||||
|
||||
sh("security delete-identity -Z #{SIGNING_IDENTITY_SHA1.shellescape} || true", log: false)
|
||||
keychain_path = ENV["MATCH_KEYCHAIN_NAME"].to_s
|
||||
keychain_path = ci_login_keychain_path unless present?(keychain_path)
|
||||
|
||||
sh("security delete-identity -Z #{SIGNING_IDENTITY_SHA1.shellescape} #{keychain_path.shellescape} || true", log: false)
|
||||
end
|
||||
|
||||
private_lane :prepare_ci_keychain do
|
||||
next unless ENV["CI"]
|
||||
|
||||
cleanup_ci_signing_identity
|
||||
ENV.delete("MATCH_KEYCHAIN_NAME")
|
||||
ENV["MATCH_KEYCHAIN_NAME"] = ci_login_keychain_path
|
||||
ENV.delete("MATCH_KEYCHAIN_PASSWORD")
|
||||
cleanup_ci_signing_identity
|
||||
end
|
||||
|
||||
private_lane :verify_ci_signing_identity do
|
||||
next unless ENV["CI"]
|
||||
|
||||
identities = sh("security find-identity -v -p codesigning", log: false)
|
||||
keychain_path = ENV.fetch("MATCH_KEYCHAIN_NAME")
|
||||
identities = sh("security find-identity -v -p codesigning #{keychain_path.shellescape}", log: false)
|
||||
UI.message(identities)
|
||||
|
||||
unless identities.include?(SIGNING_IDENTITY_NAME)
|
||||
@@ -135,7 +146,8 @@ platform :ios do
|
||||
|
||||
if ENV["CI"]
|
||||
build_options[:xcargs] = [
|
||||
"CODE_SIGN_IDENTITY=#{SIGNING_IDENTITY_SHA1.shellescape}"
|
||||
"CODE_SIGN_IDENTITY=#{SIGNING_IDENTITY_SHA1.shellescape}",
|
||||
"OTHER_CODE_SIGN_FLAGS=#{("--keychain #{ENV.fetch("MATCH_KEYCHAIN_NAME")}").shellescape}"
|
||||
].join(" ")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user