Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#454] Use appStoreConnectApiKey() for fastlane match #540

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
API_KEY_ID=""
ISSUER_ID=""
APPSTORE_CONNECT_API_KEY=""
6 changes: 6 additions & 0 deletions fastlane/Constants/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ enum Constant {
static let appleProductionTeamId = "<#teamId#>"
static let keychainName = "{PROJECT_NAME}_keychain"
static let matchURL = "[email protected]:{organization}/{repo}.git"
static let apiKey: [String: Any] = [
"key_id" : Secret.appStoreKeyIdKey,
"issuer_id": Secret.appStoreIssuerIdKey,
"key": Secret.appstoreConnectAPIKey,
"in_house": false
]

// MARK: - Path

Expand Down
1 change: 1 addition & 0 deletions fastlane/Fastfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class Fastfile: LaneFile {
registerDevice(
name: deviceName,
udid: deviceUDID,
apiKey: .userDefined(Constant.apiKey),
blyscuit marked this conversation as resolved.
Show resolved Hide resolved
teamId: .userDefined(Constant.appleStagingTeamId)
)

Expand Down
1 change: 1 addition & 0 deletions fastlane/Helpers/Match.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum Match {
type: type.match,
readonly: .userDefined(!isForce),
appIdentifier: [environment.bundleId],
apiKey: .userDefined(Constant.apiKey),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not recommend to use apiKey for match like that. Or in case we must do it, please check isForce too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added checking isForce at a3d7e1f 🙏

username: .userDefined(environment.appleUsername),
teamId: .userDefined(environment.appleTeamId),
gitUrl: Constant.matchURL,
Expand Down