Skip to content

Commit

Permalink
add custom-keychain-name input
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong-sik committed May 4, 2023
1 parent 8112fe7 commit 6e9e54b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ App Store Connect API Key Issuer ID. Default `""`.

Base64 encoded App Store Connect API Key. Default `""`.

### `custom-keychain-name`

Custom keychain name. Default `ios-build.keychain`

## Contributions Welcome!

Expand Down Expand Up @@ -210,3 +213,18 @@ Welcome your contributions!
team-id: ${{ secrets.TEAM_ID }}
workspace-path: Unity-iPhone.xcworkspace # optional
```

### custom keychain name

```yaml
- uses: yukiarrr/[email protected]
with:
custom-keychain-name: my-ios-build.keychin # or {commit-hash}-ios-build.keychain
project-path: Unity-iPhone.xcodeproj
p12-key-base64: ${{ secrets.P12_KEY_BASE64 }}
p12-cer-base64: ${{ secrets.P12_CER_BASE64 }}
mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.TEAM_ID }}
workspace-path: Unity-iPhone.xcworkspace # optional
```
16 changes: 11 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ platform :ios do
decode_file

keychain_password = SecureRandom.uuid
keychain_name = nil
if !ENV['CUSTOM_KEYCHAIN_NAME'].empty?
keychain_name = ENV['CUSTOM_KEYCHAIN_NAME']
else
keychain_name = 'ios-build.keychain'
end

create_keychain(
name: 'ios-build.keychain',
name: keychain_name,
password: keychain_password,
default_keychain: true,
unlock: true,
Expand All @@ -24,7 +30,7 @@ platform :ios do
'ios-build-key.p12'
end,
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: 'ios-build.keychain',
keychain_name: keychain_name,
keychain_password: keychain_password,
log_output: true
)
Expand All @@ -36,7 +42,7 @@ platform :ios do
'ios-build-key.cer'
end,
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: 'ios-build.keychain',
keychain_name: keychain_name,
keychain_password: keychain_password,
log_output: true
)
Expand All @@ -45,7 +51,7 @@ platform :ios do
certificate_path:
!ENV['P12_PATH'].empty? ? ENV['P12_PATH'] : 'ios-build.p12',
certificate_password: ENV['CERTIFICATE_PASSWORD'],
keychain_name: 'ios-build.keychain',
keychain_name: keychain_name,
keychain_password: keychain_password,
log_output: true
)
Expand Down Expand Up @@ -210,7 +216,7 @@ platform :ios do
build_path: use_build_path ? ENV['BUILD_PATH'] : nil
)

delete_keychain(name: 'ios-build.keychain')
delete_keychain(name: keychain_name)
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 @@ -65,6 +65,7 @@ async function run() {
process.env.APP_STORE_CONNECT_API_KEY_ISSUER_ID = core.getInput('app-store-connect-api-key-issuer-id');
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');

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

0 comments on commit 6e9e54b

Please sign in to comment.