Files
Sybil-2/ios/fastlane/Fastfile

48 lines
1.5 KiB
Plaintext
Raw Normal View History

2026-06-05 23:19:14 -07:00
default_platform(:ios)
2026-07-27 17:29:28 -07:00
platform :ios do
desc "Build a release tag and upload it to TestFlight"
lane :beta do
setup_ci
2026-06-05 23:19:14 -07:00
2026-07-27 17:29:28 -07:00
match(type: "appstore")
2026-07-27 17:29:28 -07:00
tag = ENV.fetch("GITHUB_REF_NAME")
version = tag[%r{\Arelease/ios/v(\d+\.\d+\.\d+)\z}, 1]
UI.user_error!("Expected a tag in the form release/ios/vX.Y.Z; got #{tag.inspect}") unless version
2026-07-27 17:29:28 -07:00
build_number = ENV.fetch("GITHUB_RUN_NUMBER")
UI.user_error!("GITHUB_RUN_NUMBER must be a positive integer") unless build_number.match?(/\A[1-9]\d*\z/)
2026-07-27 17:36:31 -07:00
ios_dir = File.expand_path("..", __dir__)
project_spec = File.join(ios_dir, "Apps/Sybil/project.yml")
2026-07-27 17:29:28 -07:00
contents = File.read(project_spec)
unless contents.match?(/^\s*MARKETING_VERSION:/) && contents.match?(/^\s*CURRENT_PROJECT_VERSION:/)
UI.user_error!("Could not find version settings in #{project_spec}")
end
contents.sub!(/^(\s*MARKETING_VERSION:\s*).*/, "\\1\"#{version}\"")
contents.sub!(/^(\s*CURRENT_PROJECT_VERSION:\s*).*/, "\\1#{build_number}")
File.write(project_spec, contents)
2026-07-27 17:36:31 -07:00
sh("xcodegen", "--spec", File.join(ios_dir, "project.yml"))
2026-07-27 17:29:28 -07:00
api_key = app_store_connect_api_key(
key_id: ENV.fetch("ASC_KEY_ID"),
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
key_content: ENV.fetch("ASC_KEY"),
is_key_content_base64: true
)
2026-06-05 23:19:14 -07:00
2026-07-27 17:36:31 -07:00
build_app(
project: File.join(ios_dir, "Sybil.xcodeproj"),
scheme: "Sybil"
)
upload_to_testflight(
api_key: api_key,
2026-07-27 17:29:28 -07:00
skip_waiting_for_build_processing: true,
uses_non_exempt_encryption: false
)
2026-06-05 23:19:14 -07:00
end
end