Skip to content

Commit

Permalink
add option to skip keychain deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaxjiang96 committed Oct 24, 2024
1 parent d184715 commit 2d5ce4c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ inputs:
description: 'Custom Keychain Name'
required: false
default: "ios-build.keychain"
skip-keychain-deletion:
description: 'Skip Keychain deletion'
required: false
default: ""
runs:
using: "node20"
main: "dist/index.js"
15 changes: 8 additions & 7 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ platform :ios do
lane :export_ipa do
decode_file

keychain_password = SecureRandom.uuid
keychain_name = nil
if !ENV['CUSTOM_KEYCHAIN_NAME'].empty?
keychain_name = ENV['CUSTOM_KEYCHAIN_NAME']
Expand All @@ -22,7 +21,7 @@ platform :ios do
end
create_keychain(
name: keychain_name,
password: keychain_password,
password: "",
default_keychain: false,
unlock: true,
timeout: 3600
Expand All @@ -38,7 +37,7 @@ platform :ios do
end,
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: keychain_name,
keychain_password: keychain_password,
keychain_password: "",
log_output: true
)
import_certificate(
Expand All @@ -50,7 +49,7 @@ platform :ios do
end,
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: keychain_name,
keychain_password: keychain_password,
keychain_password: "",
log_output: true
)
else
Expand All @@ -59,7 +58,7 @@ platform :ios do
!ENV['P12_PATH'].empty? ? ENV['P12_PATH'] : 'ios-build.p12',
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: keychain_name,
keychain_password: keychain_password,
keychain_password: "",
log_output: true
)
end
Expand Down Expand Up @@ -222,8 +221,10 @@ platform :ios do
destination: use_build_destination ? ENV['BUILD_DESTINATION'] : nil,
build_path: use_build_path ? ENV['BUILD_PATH'] : nil
)

delete_keychain(name: keychain_name)
# if ENV['SKIP_KEYCHAIN_DELETION'].empty? ||
# ENV['SKIP_KEYCHAIN_DELETION'] != 'true'
# delete_keychain(name: keychain_name)
# end
end

# https://github.com/CocoaPods/Xcodeproj/issues/505#issuecomment-584699008
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async function run() {
process.env.APP_STORE_CONNECT_API_KEY_BASE64 = core.getInput('app-store-connect-api-key-base64');
process.env.BUILD_PATH = core.getInput('build-path');
process.env.CUSTOM_KEYCHAIN_NAME = core.getInput('custom-keychain-name');
process.env.SKIP_KEYCHAIN_DELETION = core.getInput('skip-keychain-deletion');

// Execute build.sh
await exec.exec(`bash ${__dirname}/../build.sh`);
Expand Down

0 comments on commit 2d5ce4c

Please sign in to comment.