fix: GHA build issue on iOS (#23849)
* fix: GHA build issue on iOS * fix: resolve Swift Package dependencies in GitHub Actions * fix: use Release configuration for iOS build * fix: simplify code signing for build-only lane * fix: explicitly resolve Swift packages before building * fix: use specified XCode versionpull/23864/head
parent
5186092faa
commit
8969b8bdb2
|
|
@ -188,8 +188,8 @@ jobs:
|
||||||
needs: pre-job
|
needs: pre-job
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
# Run on main branch or workflow_dispatch
|
# Run on main branch or workflow_dispatch, or on PRs/other branches (build only, no upload)
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork && fromJSON(needs.pre-job.outputs.should_run).mobile == true && github.ref == 'refs/heads/main' }}
|
if: ${{ !github.event.pull_request.head.repo.fork && fromJSON(needs.pre-job.outputs.should_run).mobile == true }}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -303,12 +303,20 @@ jobs:
|
||||||
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
|
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
|
||||||
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
|
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
|
||||||
ENVIRONMENT: ${{ inputs.environment || 'development' }}
|
ENVIRONMENT: ${{ inputs.environment || 'development' }}
|
||||||
|
BUNDLE_ID_SUFFIX: ${{ inputs.environment == 'production' && '' || 'development' }}
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
working-directory: ./mobile/ios
|
working-directory: ./mobile/ios
|
||||||
run: |
|
run: |
|
||||||
if [[ "$ENVIRONMENT" == "development" ]]; then
|
# Only upload to TestFlight on main branch
|
||||||
bundle exec fastlane gha_testflight_dev
|
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
|
||||||
|
if [[ "$ENVIRONMENT" == "development" ]]; then
|
||||||
|
bundle exec fastlane gha_testflight_dev
|
||||||
|
else
|
||||||
|
bundle exec fastlane gha_release_prod
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
bundle exec fastlane gha_release_prod
|
# Build only, no TestFlight upload for non-main branches
|
||||||
|
bundle exec fastlane gha_build_only
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Clean up keychain
|
- name: Clean up keychain
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ end
|
||||||
workspace: "Runner.xcworkspace",
|
workspace: "Runner.xcworkspace",
|
||||||
configuration: configuration,
|
configuration: configuration,
|
||||||
export_method: "app-store",
|
export_method: "app-store",
|
||||||
xcargs: "CODE_SIGN_IDENTITY='#{CODE_SIGN_IDENTITY}' CODE_SIGN_STYLE=Manual",
|
xcargs: "-skipMacroValidation CODE_SIGN_IDENTITY='#{CODE_SIGN_IDENTITY}' CODE_SIGN_STYLE=Manual",
|
||||||
export_options: {
|
export_options: {
|
||||||
provisioningProfiles: {
|
provisioningProfiles: {
|
||||||
"#{app_identifier}" => "#{app_identifier} AppStore",
|
"#{app_identifier}" => "#{app_identifier} AppStore",
|
||||||
|
|
@ -195,7 +195,7 @@ end
|
||||||
configuration: "Release",
|
configuration: "Release",
|
||||||
export_method: "app-store",
|
export_method: "app-store",
|
||||||
skip_package_ipa: false,
|
skip_package_ipa: false,
|
||||||
xcargs: "-allowProvisioningUpdates",
|
xcargs: "-skipMacroValidation -allowProvisioningUpdates",
|
||||||
export_options: {
|
export_options: {
|
||||||
method: "app-store",
|
method: "app-store",
|
||||||
signingStyle: "automatic",
|
signingStyle: "automatic",
|
||||||
|
|
@ -210,4 +210,37 @@ end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "iOS Build Only (no TestFlight upload)"
|
||||||
|
lane :gha_build_only do
|
||||||
|
# Use the same build process as production, just skip the upload
|
||||||
|
# This ensures PR builds validate the same way as production builds
|
||||||
|
|
||||||
|
# Install provisioning profiles (use development profiles for PR builds)
|
||||||
|
install_provisioning_profile(path: "profile_dev.mobileprovision")
|
||||||
|
install_provisioning_profile(path: "profile_dev_share.mobileprovision")
|
||||||
|
install_provisioning_profile(path: "profile_dev_widget.mobileprovision")
|
||||||
|
|
||||||
|
# Configure code signing for dev bundle IDs
|
||||||
|
configure_code_signing(bundle_id_suffix: "development")
|
||||||
|
|
||||||
|
# Build the app (same as gha_testflight_dev but without upload)
|
||||||
|
build_app(
|
||||||
|
scheme: "Runner",
|
||||||
|
workspace: "Runner.xcworkspace",
|
||||||
|
configuration: "Release",
|
||||||
|
export_method: "app-store",
|
||||||
|
skip_package_ipa: true,
|
||||||
|
xcargs: "-skipMacroValidation CODE_SIGN_IDENTITY='#{CODE_SIGN_IDENTITY}' CODE_SIGN_STYLE=Manual",
|
||||||
|
export_options: {
|
||||||
|
provisioningProfiles: {
|
||||||
|
"#{BASE_BUNDLE_ID}.development" => "#{BASE_BUNDLE_ID}.development AppStore",
|
||||||
|
"#{BASE_BUNDLE_ID}.development.ShareExtension" => "#{BASE_BUNDLE_ID}.development.ShareExtension AppStore",
|
||||||
|
"#{BASE_BUNDLE_ID}.development.Widget" => "#{BASE_BUNDLE_ID}.development.Widget AppStore"
|
||||||
|
},
|
||||||
|
signingStyle: "manual",
|
||||||
|
signingCertificate: CODE_SIGN_IDENTITY
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue