Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
159 lines (151 sloc) 4.14 KB
# update_fastlane
default_platform(:ios)
platform :ios do
before_all do
if is_ci?
puts "This is CI run. Setting custom keychain."
ENV['KEYCHAIN_NAME'] = "Temp.keychain"
create_keychain(
name: ENV['KEYCHAIN_NAME'],
password: ENV['KEYCHAIN_NAME'],
default_keychain: true,
unlock: true,
timeout: 3600,
)
end
end
desc "Submit a new build to Firebase App Distribution"
lane :tst do
add_badge(dark: true)
register_devices(
devices_file: "fastlane/devices.txt",
team_id: ENV["APPLE_DEVELOPER_TEAM_ID"],
username: ENV["FASTLANE_EMAIL"]
)
match(
type: "adhoc",
force_for_new_devices: true,
keychain_name: ENV['KEYCHAIN_NAME'],
keychain_password: ENV['KEYCHAIN_NAME']
)
automatic_code_signing(
use_automatic_signing: false,
path: "ios/Runner.xcodeproj"
)
update_project_provisioning(
profile: ENV["sigh_#{ENV["APP_ID"]}_adhoc_profile-path"],
build_configuration: "Release-tst",
code_signing_identity: "iPhone Distribution",
xcodeproj: "ios/Runner.xcodeproj",
)
set_info_plist_value(
path: "./ios/Runner/Info.plist",
key: "CFBundleVersion",
value: ENV["BUILD_NUMBER"]
)
set_info_plist_value(
path: "./ios/Runner/Info.plist",
key: "CFBundleShortVersionString",
value: ENV["VERSION_NUMBER"]
)
build_ios_app(
scheme: "tst",
configuration: "Release-tst",
xcargs: "-allowProvisioningUpdates",
export_options: {
signingStyle: "manual",
method: "ad-hoc",
provisioningProfiles: {
"#{ENV["APP_ID"]}": "match AdHoc #{ENV["APP_ID"]}"
}
},
output_name: "Runner.ipa",
workspace: "ios/Runner.xcworkspace"
)
firebase_app_distribution(
app: ENV["FIREBASE_IOS_TEST_APP_ID"],
ipa_path: "Runner.ipa",
firebase_cli_token: ENV["FIREBASE_CLI_TOKEN"],
release_notes: ENV["FL_CHANGELOG"],
groups: ENV["FIREBASE_TESTERS"]
)
finish_build
end
desc "Deploy a new version to the AppStore"
lane :prod do
match(
type: "appstore",
keychain_name: ENV['KEYCHAIN_NAME'],
keychain_password: ENV['KEYCHAIN_NAME']
)
automatic_code_signing(
use_automatic_signing: false,
path: "ios/Runner.xcodeproj"
)
update_project_team(
path: "ios/Runner.xcodeproj",
teamid: ENV["APPLE_DEVELOPER_TEAM_ID"],
)
update_project_provisioning(
profile: ENV["sigh_#{ENV["APP_ID"]}_appstore_profile-path"],
build_configuration: "Release-prod",
code_signing_identity: "iPhone Distribution",
xcodeproj: "ios/Runner.xcodeproj"
)
build_app(
scheme: "prod",
configuration: "Release-prod",
xcargs: "-allowProvisioningUpdates",
export_options: {
signingStyle: "manual",
method: "appstore",
provisioningProfiles: {
"#{ENV["APP_ID"]}": "match AppStore #{ENV["APP_ID"]}"
}
},
output_name: "Runner.ipa",
workspace: "ios/Runner.xcworkspace"
)
upload_to_testflight(
app_identifier: ENV["APP_ID"],
username: ENV["FASTLANE_USER"],
skip_waiting_for_build_processing: true,
team_id: ENV["APP_STORE_CONNECT_TEAM_ID"],
ipa: "Runner.ipa"
)
finish_build
end
end
platform :android do
desc "Submit a new build to Firebase App Distribution"
lane :tst do
firebase_app_distribution(
app: ENV["FIREBASE_ANDROID_TEST_APP_ID"],
apk_path: ENV["APK_PATH"],
release_notes: ENV["FL_CHANGELOG"],
firebase_cli_token: ENV["FIREBASE_CLI_TOKEN"],
groups: ENV["FIREBASE_TESTERS"]
)
finish_build
end
desc "Deploy a new version to the Google Play"
lane :prod do
upload_to_play_store(
track: 'internal',
json_key: ENV["GOOGLE_SERVICE_ACCOUNT_KEY"],
package_name: ENV["APP_ID"],
aab: ENV["AAB_PATH"],
skip_upload_screenshots: true
)
finish_build
end
end
def finish_build
if is_ci?
add_git_tag(
grouping: "fastlane-builds",
prefix: ENV["FASTLANE_LANE_NAME"],
build_number: ENV["BUILD_NUMBER"]
)
end
end
You can’t perform that action at this time.