passforios/fastlane/Fastfile

189 lines
5.7 KiB
Text
Raw Normal View History

2017-03-24 23:16:58 -07:00
default_platform :ios
2020-07-19 18:16:16 -07:00
lane :prepare do
carthage(cache_builds: true, platform: "iOS")
2020-12-29 19:44:00 -08:00
sh "./scripts/gopenpgp_build.sh"
2020-07-19 18:16:16 -07:00
end
lane :reset_build_number do
increment_build_number(
build_number: 0,
xcodeproj: "pass.xcodeproj"
)
end
lane :match_development do
app_identifier = "me.mssun.passforios"
match(
type: "development",
2020-07-25 00:34:31 -07:00
git_url: "https://github.com/mssun/certificates-passforios",
git_basic_authorization: ENV['MATCH_GIT_BASIC_AUTHORIZATION'],
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
app_identifier: [app_identifier,
"#{app_identifier}.find-login-action-extension",
"#{app_identifier}.auto-fill-credential-extension",
"#{app_identifier}.shortcuts"],
readonly: true
)
end
lane :match_appstore do
app_identifier = "me.mssun.passforios"
match(
type: "appstore",
git_url: "https://github.com/mssun/certificates-passforios",
git_basic_authorization: ENV['MATCH_GIT_BASIC_AUTHORIZATION'],
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
app_identifier: [app_identifier,
"#{app_identifier}.find-login-action-extension",
"#{app_identifier}.auto-fill-credential-extension",
"#{app_identifier}.shortcuts"],
readonly: true
)
end
lane :match_appstore_beta do
app_identifier = "me.mssun.passforiosbeta"
match(
type: "appstore",
git_url: "https://github.com/mssun/certificates-passforios",
git_basic_authorization: ENV['MATCH_GIT_BASIC_AUTHORIZATION'],
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
2020-07-19 18:16:16 -07:00
app_identifier: [app_identifier,
"#{app_identifier}.find-login-action-extension",
"#{app_identifier}.auto-fill-credential-extension",
"#{app_identifier}.shortcuts"],
readonly: true
)
end
2017-03-24 23:16:58 -07:00
platform :ios do
2019-06-08 14:56:29 -07:00
desc "Runs all tests"
2017-03-24 23:16:58 -07:00
lane :test do
2020-12-31 21:56:48 -08:00
run_tests(scheme: "pass")
2017-03-24 23:16:58 -07:00
end
desc "Submit a new Beta Build to Apple TestFlight"
desc "This will also make sure the profile is up to date"
lane :beta do
2020-07-19 18:16:16 -07:00
app_identifier = "me.mssun.passforiosbeta"
2020-12-29 19:44:00 -08:00
if is_ci?
2020-12-31 23:31:01 -08:00
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
default_keychain: false,
unlock: true,
timeout: 3600,
add_to_search_list: true
)
2020-12-29 19:44:00 -08:00
match_appstore_beta
end
2020-07-19 18:16:16 -07:00
increment_build_number(
build_number: latest_testflight_build_number(
version: get_version_number(target: "pass"),
app_identifier: app_identifier,
initial_build_number: 0
) + 1,
xcodeproj: "pass.xcodeproj"
2017-03-28 10:40:31 -07:00
)
2020-07-19 18:16:16 -07:00
build_app(
scheme: "pass",
configuration: "Beta",
2020-07-25 00:34:31 -07:00
skip_profile_detection: true,
2022-05-22 16:26:00 -07:00
export_method: "app-store",
2020-07-25 00:34:31 -07:00
export_options: {
method: "app-store",
provisioningProfiles: {
app_identifier => "match AppStore #{app_identifier}",
"#{app_identifier}.find-login-action-extension" => "match AppStore #{app_identifier}.find-login-action-extension",
"#{app_identifier}.auto-fill-credential-extension" => "match AppStore #{app_identifier}.auto-fill-credential-extension",
"#{app_identifier}.shortcuts" => "match AppStore #{app_identifier}.shortcuts",
},
},
2020-07-19 18:16:16 -07:00
verbose: true
)
upload_to_testflight(
app_identifier: app_identifier,
skip_waiting_for_build_processing: true
)
increment_build_number(
build_number: 0,
xcodeproj: "pass.xcodeproj"
)
2020-07-26 16:00:18 -07:00
if is_ci?
2020-07-19 18:16:16 -07:00
notify_dev
end
end
desc "Submit a new build to AppStore"
lane :release do
app_identifier = "me.mssun.passforios"
2020-12-29 19:44:00 -08:00
if is_ci?
2020-12-31 23:31:01 -08:00
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
default_keychain: false,
unlock: true,
timeout: 3600,
add_to_search_list: true
)
2020-12-29 19:44:00 -08:00
match_appstore
end
2017-03-28 09:36:41 -07:00
increment_build_number(
2020-07-19 18:16:16 -07:00
build_number: latest_testflight_build_number(
version: get_version_number(target: "pass"),
app_identifier: app_identifier,
initial_build_number: 0
) + 1,
2017-03-28 09:36:41 -07:00
xcodeproj: "pass.xcodeproj"
)
2019-06-08 14:56:29 -07:00
build_app(
scheme: "pass",
2020-07-19 18:16:16 -07:00
configuration: "Release",
2020-07-25 00:34:31 -07:00
skip_profile_detection: true,
export_options: {
method: "app-store",
provisioningProfiles: {
app_identifier => "match AppStore #{app_identifier}",
"#{app_identifier}.find-login-action-extension" => "match AppStore #{app_identifier}.find-login-action-extension",
"#{app_identifier}.auto-fill-credential-extension" => "match AppStore #{app_identifier}.auto-fill-credential-extension",
"#{app_identifier}.shortcuts" => "match AppStore #{app_identifier}.shortcuts",
},
},
verbose: true
)
2019-06-08 14:56:29 -07:00
upload_to_testflight(
2020-07-19 18:16:16 -07:00
app_identifier: app_identifier,
skip_waiting_for_build_processing: true
)
increment_build_number(
build_number: 0,
xcodeproj: "pass.xcodeproj"
)
2020-07-26 16:00:18 -07:00
if is_ci?
2020-07-19 18:16:16 -07:00
notify_dev
end
end
desc 'Notify developers'
lane :notify_dev do
2017-03-28 10:40:31 -07:00
mailgun(
postmaster: ENV["MY_POSTMASTER"],
apikey: ENV["MY_API_KEY"],
to: ENV["DESTINATION_EMAIL"],
from: ENV["EMAIL_FROM_NAME"],
reply_to: ENV["EMAIL_REPLY_TO"],
subject: "A new build of Pass for iOS has been uploaded",
success: true,
app_link: "https://github.com/mssun/passforios",
2020-12-23 20:26:58 -08:00
ci_build_link: "https://github.com/mssun/passforios/actions",
message: "A new build has been uploaded by GitHub Action.",
2017-03-28 10:40:31 -07:00
)
2017-03-24 23:16:58 -07:00
end
end