2021-01-02 13:39:30 +00:00
|
|
|
# This file contains the fastlane.tools configuration
|
|
|
|
# You can find the documentation at https://docs.fastlane.tools
|
|
|
|
#
|
|
|
|
# For a list of all available actions, check out
|
|
|
|
#
|
|
|
|
# https://docs.fastlane.tools/actions
|
|
|
|
#
|
|
|
|
# For a list of all available plugins, check out
|
|
|
|
#
|
|
|
|
# https://docs.fastlane.tools/plugins/available-plugins
|
|
|
|
#
|
|
|
|
|
|
|
|
# Uncomment the line if you want fastlane to automatically update itself
|
|
|
|
# update_fastlane
|
|
|
|
|
2024-09-23 13:02:26 +00:00
|
|
|
fastlane_require "dotenv"
|
2024-10-11 17:51:06 +00:00
|
|
|
fastlane_require "fileutils"
|
2024-09-23 13:02:26 +00:00
|
|
|
Dotenv.load ".env.secret"
|
|
|
|
|
|
|
|
setup_ci if ENV["CI"]
|
2024-11-28 23:10:22 +00:00
|
|
|
api = "Library/Sources/CommonAPI/API"
|
2024-11-27 18:10:23 +00:00
|
|
|
metadata = "fastlane/metadata"
|
2024-09-23 13:02:26 +00:00
|
|
|
logname = "CHANGELOG.txt"
|
2024-11-12 17:35:44 +00:00
|
|
|
build_path = "build"
|
|
|
|
derived_data_path = "build/derived_data"
|
2024-09-23 13:02:26 +00:00
|
|
|
|
|
|
|
desc "Bump version"
|
|
|
|
lane :bump do |options|
|
2024-11-27 16:08:00 +00:00
|
|
|
unless options[:no_log]
|
2024-11-07 17:35:00 +00:00
|
|
|
if options[:since]
|
|
|
|
between = [options[:since], "HEAD"]
|
|
|
|
else
|
|
|
|
between = nil
|
|
|
|
end
|
2024-09-30 16:11:00 +00:00
|
|
|
log = changelog_from_git_commits(
|
2024-11-07 17:35:00 +00:00
|
|
|
between: between,
|
2024-10-29 15:02:06 +00:00
|
|
|
pretty: "* %s",
|
2024-09-30 16:11:00 +00:00
|
|
|
date_format: "short"
|
|
|
|
)
|
|
|
|
path = "../#{logname}"
|
2024-10-11 17:51:06 +00:00
|
|
|
path_tmp = "#{path}.tmp"
|
|
|
|
File.open(path_tmp, "w") { |file|
|
2024-09-30 16:11:00 +00:00
|
|
|
file.write(log)
|
|
|
|
}
|
2024-10-11 17:51:06 +00:00
|
|
|
if system("vim", path_tmp)
|
|
|
|
FileUtils.mv(path_tmp, path)
|
|
|
|
else
|
|
|
|
File.delete(path_tmp)
|
|
|
|
UI.user_error!("CHANGELOG editor cancelled")
|
|
|
|
end
|
2024-10-04 18:58:11 +00:00
|
|
|
end
|
|
|
|
version = options[:version]
|
|
|
|
build = options[:build]
|
|
|
|
increment_build_number(build_number: build)
|
|
|
|
unless version.nil? || version.empty?
|
|
|
|
increment_version_number_in_xcodeproj(version_number: version)
|
2024-09-30 16:11:00 +00:00
|
|
|
end
|
2024-11-28 23:10:22 +00:00
|
|
|
git_add(
|
|
|
|
path: [api, metadata, logname]
|
|
|
|
)
|
2024-09-23 13:02:26 +00:00
|
|
|
commit_version_bump(
|
|
|
|
message: "Bump version",
|
2024-11-28 23:10:22 +00:00
|
|
|
force: true
|
2024-09-23 13:02:26 +00:00
|
|
|
)
|
2024-09-23 13:25:16 +00:00
|
|
|
add_git_tag(
|
|
|
|
includes_lane: false,
|
|
|
|
sign: true
|
|
|
|
)
|
2024-09-23 13:02:26 +00:00
|
|
|
end
|
|
|
|
|
2024-11-12 17:35:44 +00:00
|
|
|
desc "Run Xcode tests"
|
2024-11-12 15:42:19 +00:00
|
|
|
lane :test do
|
|
|
|
scan(
|
|
|
|
xcargs: "CODE_SIGNING_ALLOWED=NO",
|
2024-11-12 17:35:44 +00:00
|
|
|
derived_data_path: derived_data_path
|
2024-11-12 15:42:19 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2024-09-23 13:02:26 +00:00
|
|
|
desc "Push a new beta build to TestFlight"
|
|
|
|
lane :beta do
|
2024-09-24 15:51:01 +00:00
|
|
|
preface = ENV["TESTFLIGHT_PREFACE"]
|
2024-09-23 13:02:26 +00:00
|
|
|
log = File.read("../#{logname}")
|
2024-09-25 14:43:09 +00:00
|
|
|
changelog = preface + log
|
2024-09-23 13:02:26 +00:00
|
|
|
match(type: "appstore")
|
|
|
|
gym(
|
|
|
|
clean: true,
|
2024-11-12 17:35:44 +00:00
|
|
|
build_path: build_path,
|
|
|
|
derived_data_path: derived_data_path
|
2024-09-23 13:02:26 +00:00
|
|
|
)
|
|
|
|
pilot(
|
2024-09-23 13:44:21 +00:00
|
|
|
changelog: changelog,
|
2024-09-23 13:02:26 +00:00
|
|
|
distribute_external: true,
|
|
|
|
notify_external_testers: false
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Distribute to Public Beta"
|
|
|
|
lane :public_beta do
|
|
|
|
pilot(
|
|
|
|
distribute_only: true,
|
|
|
|
distribute_external: true,
|
|
|
|
notify_external_testers: true
|
|
|
|
)
|
|
|
|
end
|
2024-11-27 18:10:23 +00:00
|
|
|
|
|
|
|
desc "Update App Store metadata"
|
|
|
|
lane :asc_metadata do
|
|
|
|
deliver(
|
|
|
|
skip_metadata: false,
|
|
|
|
skip_screenshots: true
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Update App Store screenshots"
|
|
|
|
lane :asc_screenshots do
|
|
|
|
deliver(
|
|
|
|
skip_metadata: true,
|
|
|
|
skip_screenshots: false
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Submit a build to App Review"
|
|
|
|
lane :asc_review do |options|
|
|
|
|
deliver(
|
|
|
|
submit_for_review: true,
|
|
|
|
skip_binary_upload: true,
|
|
|
|
skip_metadata: false,
|
|
|
|
skip_screenshots: false,
|
|
|
|
submission_information: {
|
|
|
|
add_id_info_uses_idfa: false,
|
|
|
|
export_compliance_uses_encryption: false
|
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Tag release"
|
|
|
|
lane :tag_release do |options|
|
|
|
|
version = options[:version]
|
|
|
|
tag = "v#{version}"
|
|
|
|
add_git_tag(
|
|
|
|
tag: tag,
|
|
|
|
sign: true
|
|
|
|
)
|
|
|
|
push_git_tags(
|
|
|
|
tag: tag
|
|
|
|
)
|
|
|
|
end
|