Skip to content

Commit

Permalink
try tbc's fastlane file
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Nov 3, 2023
1 parent 46c4019 commit d2483c4
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ios-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}
with:
lane: 'beta'
lane: 'build_upload_testflight'
subdirectory: 'ios/App'

- name: Upload release bundle
Expand Down
1 change: 1 addition & 0 deletions ios/App/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"
120 changes: 108 additions & 12 deletions ios/App/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,117 @@

default_platform(:ios)

ISSUER_ID = ENV["APPLE_ISSUER_ID"]
KEY_ID = ENV["APPLE_KEY_ID"]
KEY_CONTENT = ENV["APPLE_KEY_CONTENT"]
APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"]
APPLE_KEY_ID = ENV["APPLE_KEY_ID"]
APPLE_KEY_CONTENT = ENV["APPLE_KEY_CONTENT"]


def delete_temp_keychain()
delete_keychain(
name: 'signing_temp.keychain-db'
) if File.exist?(ENV["KEYCHAIN_PATH"])
end


platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
api_key = app_store_connect_api_key(
key_id: KEY_ID,
issuer_id: ISSUER_ID,
key_content: KEY_CONTENT
desc "Init fastlane and build iOS"
lane :init_build_upload do
app_store_connect_api_key(
key_id: APPLE_KEY_ID,
issuer_id: APPLE_ISSUER_ID,
key_content: APPLE_KEY_CONTENT,
is_key_content_base64: false,
in_house: false
)
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

current_version = get_version_number(
target: "App"
)
latest_build_number = latest_testflight_build_number(
api_key: api_key,
version: current_version,
app_identifier: app_identifier
)
increment_build_number(
build_number: (latest_build_number + 1),
)
cocoapods(
clean_install: true
)

app_id = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

profile_name = "mutiny-wallet-appstore"

cert(
api_key: api_key,
keychain_path: ENV["KEYCHAIN_PATH"]
)

sigh(
api_key: api_key,
app_identifier: app_id,
provisioning_name: profile_name,
force: true
)

app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

output_name = "mutiny-wallet-iOS"
export_method = "app-store"
compile_bitcode = true

update_code_signing_settings(
use_automatic_signing: false,
targets: ["main-target"],
code_sign_identity: "Apple Distribution",
bundle_identifier: app_identifier,
profile_name: profile_name,
build_configurations: ["Release"]
)

gym(
scheme: "App",
output_name: output_name,
configuration: "Release",
export_options: {
method: export_method,
provisioningProfiles: {
app_identifier => app_identifier
},
compileBitcode: compile_bitcode
}
)

deliver(
api_key: api_key,
skip_screenshots: true,
skip_metadata: true,
skip_app_version_update: true,
force: true,
run_precheck_before_submit: false
)

version = "#{current_version}_#{latest_build_number+1}"
add_git_tag( tag: version)
push_git_tags(tag: version)

delete_temp_keychain()

end

desc "Build and upload to TestFlight"
lane :build_upload_testflight do
init_build_upload
end


increment_build_number(xcodeproj: "App.xcodeproj")
build_app(workspace: "App.xcworkspace", scheme: "App", xcargs: "-allowProvisioningUpdates")
upload_to_testflight(api_key: api_key, skip_waiting_for_build_processing: true)
desc "Upload any dsyms in the current directory to crashlytics"
lane :upload_dsyms do |options|
download_dsyms(version: lane_context[SharedValues::VERSION_NUMBER], build_number: lane_context[SharedValues::BUILD_NUMBER])
upload_symbols_to_crashlytics(dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH], gsp_path: 'ios/GoogleService-Info.plist')
clean_build_artifacts
end
end

0 comments on commit d2483c4

Please sign in to comment.