Skip to content

Commit 3df61e3

Browse files
authored
Merge pull request #6 from Multi-V-VM/copilot/modify-fastlane-for-signature
Fix App Store submission: replace manual IPA zip with proper gym export and Apple Distribution signing
2 parents 6bcb003 + b28f6c0 commit 3df61e3

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

fastlane/Fastfile

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ platform :ios do
8282
team_id: ENV["DEVELOPER_PORTAL_TEAM_ID"],
8383
bundle_identifier: DEVELOPER_APP_IDENTIFIER,
8484
profile_name: "match AppStore #{DEVELOPER_APP_IDENTIFIER}",
85-
code_sign_identity: "iPhone Distribution"
85+
code_sign_identity: "Apple Distribution"
8686
)
8787

8888
update_code_signing_settings(
@@ -91,44 +91,33 @@ platform :ios do
9191
team_id: ENV["DEVELOPER_PORTAL_TEAM_ID"],
9292
bundle_identifier: DEVELOPER_APP_EXTENSION_IDENTIFIER,
9393
profile_name: "match AppStore #{DEVELOPER_APP_EXTENSION_IDENTIFIER}",
94-
code_sign_identity: "iPhone Distribution",
94+
code_sign_identity: "Apple Distribution",
9595
targets: ["extension"]
9696
)
97-
# Archive only — skip gym's export since it injects 'method' which Xcode 26 rejects
97+
9898
gym(
9999
configuration: "Release",
100100
project: "Code.xcodeproj",
101101
scheme: "CodifyOne",
102-
skip_package_ipa: true
102+
output_name: "Code",
103+
output_directory: File.expand_path("..", __dir__),
104+
export_method: "app-store",
105+
export_options: {
106+
method: "app-store",
107+
signingStyle: "manual",
108+
provisioningProfiles: {
109+
DEVELOPER_APP_IDENTIFIER => "match AppStore #{DEVELOPER_APP_IDENTIFIER}",
110+
DEVELOPER_APP_EXTENSION_IDENTIFIER => "match AppStore #{DEVELOPER_APP_EXTENSION_IDENTIFIER}"
111+
}
112+
}
103113
)
104114

105-
# Xcode 26 xcodebuild -exportArchive injects a default 'method: development' internally
106-
# even when the plist omits it, then rejects it. Bypass by creating IPA from archive directly.
107-
archive_path = lane_context[SharedValues::XCODEBUILD_ARCHIVE]
108-
export_path = File.expand_path("../build_output", __dir__)
109-
110-
app_path = Dir["#{archive_path}/Products/Applications/*.app"].first
111-
UI.user_error!("No .app found in archive at #{archive_path}") unless app_path
112-
113-
FileUtils.mkdir_p(export_path)
114-
payload_dir = File.join(export_path, "Payload")
115-
FileUtils.rm_rf(payload_dir)
116-
FileUtils.mkdir_p(payload_dir)
117-
FileUtils.cp_r(app_path, payload_dir)
118-
119-
ipa_output = File.join(export_path, "Code.ipa")
120-
Dir.chdir(export_path) do
121-
sh("zip -r '#{ipa_output}' Payload")
122-
end
123-
124-
FileUtils.cp(ipa_output, File.expand_path("../Code.ipa", __dir__))
125-
126115
pilot(
127116
apple_id: "#{DEVELOPER_APP_ID}",
128117
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
129118
distribute_external: DISTRIBUTE_EXTERNAL,
130119
notify_external_testers: DISTRIBUTE_EXTERNAL,
131-
ipa: "./Code.ipa",
120+
ipa: File.expand_path("../Code.ipa", __dir__),
132121
changelog: "GitHub Action automated build. For detailed changes, " +
133122
"visit https://github.com/thebaselab/codeapp.\n" +
134123
"\nGenerated Changelog:\n" + changelog,

0 commit comments

Comments
 (0)