-
Notifications
You must be signed in to change notification settings - Fork 3
Ci testflight fixes #1176
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
base: main
Are you sure you want to change the base?
Ci testflight fixes #1176
Changes from 11 commits
62181b0
6bf126d
509e5ea
f6d3d0d
769d5b0
2485411
0d417df
bf507b6
fe6c72b
82651bc
4e8415d
87896a3
bf9fec0
5fa1d14
b5359df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ on: | |
| xcode_version: | ||
| description: 'Xcode version to use' | ||
| required: false | ||
| default: '16.3' | ||
| default: '26.2' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion]: Can we use a dynamic value from config for Xcode version? |
||
| type: string | ||
| project_path: | ||
| description: 'Relative path to the .xcodeproj file' | ||
|
|
@@ -90,11 +90,12 @@ jobs: | |
| inputs.bundle_identifier_extension != '' && | ||
| format(',{0}', inputs.bundle_identifier_extension) || '' | ||
| }} | ||
| DISTRIBUTION_TYPE: appstore | ||
| GIT_URL: ${{ secrets.MATCH_GIT_URL }} | ||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
| run: bundle exec fastlane download_profiles | ||
| run: | | ||
| DISTRIBUTION_TYPE=appstore bundle exec fastlane download_profiles | ||
| DISTRIBUTION_TYPE=adhoc APP_IDENTIFIER=${{ inputs.bundle_identifier }} bundle exec fastlane download_profiles | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Clarification]: Do we still need to download |
||
|
|
||
|
Comment on lines
+96
to
99
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Clarification]: @ValentinaIancu-Gini are we downloading somewhere a profile for our app extension? |
||
| - name: Archive Xcode Project | ||
| run: | | ||
|
|
@@ -107,6 +108,7 @@ jobs: | |
| CODE_SIGN_IDENTITY="Apple Distribution" \ | ||
| CODE_SIGN_STYLE=Manual \ | ||
| DEVELOPMENT_TEAM=${{ inputs.team_id }} \ | ||
| CURRENT_PROJECT_VERSION=${{ github.run_number }} \ | ||
| ONLY_ACTIVE_ARCH=NO | ||
|
|
||
| - name: Export .ipa File | ||
|
|
@@ -122,16 +124,9 @@ jobs: | |
| files: "${{ inputs.ipa_name }}.ipa" | ||
| fail: true | ||
|
|
||
| - name: Decode App Store Connect API Key | ||
| env: | ||
| APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} | ||
| run: | | ||
| mkdir -p build_artifacts | ||
| echo "$APP_STORE_CONNECT_API_KEY" | base64 --decode > build_artifacts/AppStoreConnectAPIKey.p8 | ||
|
|
||
| - name: Upload to TestFlight | ||
| env: | ||
| APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_API_KEY_ID }} | ||
| APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_API_ISSUER_ID }} | ||
| APP_STORE_CONNECT_API_KEY_PATH: build_artifacts/AppStoreConnectAPIKey.p8 | ||
| APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} | ||
| run: bundle exec fastlane publish_to_testflight ipa_path:"${{ inputs.ipa_name }}.ipa" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion]: I think we need to update also |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -688,45 +688,31 @@ end | |
| (default: build_artifacts/AppStoreConnectAPIKey.p8) | ||
| DOC | ||
| lane :publish_to_testflight do |options| | ||
| ipa_path = options[:ipa_path] || "./GiniBankSDKExample.ipa" | ||
| key_id = ENV['APP_STORE_CONNECT_API_KEY_ID'] | ||
| issuer_id = ENV['APP_STORE_CONNECT_API_ISSUER_ID'] | ||
| key_path = ENV['APP_STORE_CONNECT_API_KEY_PATH'] || "build_artifacts/AppStoreConnectAPIKey.p8" | ||
| ipa_path = options[:ipa_path] || "./GiniBankSDKExample.ipa" | ||
|
ValentinaIancu-Gini marked this conversation as resolved.
Outdated
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion]: add a comment comment and mention that it might be |
||
| key_id = ENV['APP_STORE_CONNECT_API_KEY_ID'] | ||
| issuer_id = ENV['APP_STORE_CONNECT_API_ISSUER_ID'] | ||
| key_base64 = ENV['APP_STORE_CONNECT_API_KEY'] | ||
|
|
||
| repo_root = File.expand_path("..", __dir__) | ||
| resolved_key_path = File.expand_path(key_path, repo_root) | ||
| resolved_ipa_path = File.expand_path(ipa_path, repo_root) | ||
|
|
||
| UI.user_error!("APP_STORE_CONNECT_API_KEY_ID is not set") if key_id.nil? || key_id.empty? | ||
| UI.user_error!("APP_STORE_CONNECT_API_ISSUER_ID is not set") if issuer_id.nil? || issuer_id.empty? | ||
| UI.user_error!("API key not found at: #{resolved_key_path}") unless File.exist?(resolved_key_path) | ||
| UI.user_error!("APP_STORE_CONNECT_API_KEY is not set") if key_base64.nil? || key_base64.empty? | ||
| UI.user_error!("IPA not found at: #{resolved_ipa_path}") unless File.exist?(resolved_ipa_path) | ||
|
|
||
| # xcrun altool reads .p8 keys from ~/.appstoreconnect/private_keys/AuthKey_<ID>.p8 | ||
| private_keys_dir = File.expand_path("~/.appstoreconnect/private_keys") | ||
| expected_key_path = "#{private_keys_dir}/AuthKey_#{key_id}.p8" | ||
| created_temporary_key = false | ||
| sh("mkdir -p '#{private_keys_dir}'") | ||
| unless resolved_key_path == expected_key_path | ||
| sh("cp '#{resolved_key_path}' '#{expected_key_path}'") | ||
| created_temporary_key = true | ||
| end | ||
| # Ensure restrictive permissions on the API key file | ||
| sh("chmod 600 '#{expected_key_path}'") if File.exist?(expected_key_path) | ||
|
|
||
| begin | ||
| UI.message "🚀 Uploading #{resolved_ipa_path} to TestFlight..." | ||
| sh( | ||
| "xcrun altool --upload-app" \ | ||
| " --file '#{resolved_ipa_path}'" \ | ||
| " --type ios" \ | ||
| " --apiKey '#{key_id}'" \ | ||
| " --apiIssuer '#{issuer_id}'" | ||
| ) | ||
| ensure | ||
| # Remove the temporary key copy to avoid leaving credentials on disk | ||
| sh("rm -f '#{expected_key_path}'") if created_temporary_key | ||
| end | ||
| api_key = app_store_connect_api_key( | ||
| key_id: key_id, | ||
| issuer_id: issuer_id, | ||
| key_content: key_base64, | ||
| is_key_content_base64: true | ||
| ) | ||
|
|
||
| upload_to_testflight( | ||
| ipa: resolved_ipa_path, | ||
| api_key: api_key, | ||
| skip_waiting_for_build_processing: true | ||
| ) | ||
| end | ||
|
|
||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.