Instantly share code, notes, and snippets.

Embed
What would you like to do?
Companion files for "Adding GitLab CI Support"
stages:
- test
- beta
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
test:
dependencies: []
stage: test
artifacts:
paths:
- fastlane/screenshots
- fastlane/logs
- fastlane/test_output
script:
- "carthage bootstrap --platform ios --no-use-binaries"
- fastlane test
tags:
- xcode
beta:
dependencies: []
stage: beta
artifacts:
paths:
- fastlane/screenshots
- fastlane/logs
script:
- "carthage bootstrap --platform ios --no-use-binaries"
- fastlane beta
tags:
- xcode
only:
- master
min_fastlane_version("2.73.0")
default_platform(:ios)
platform :ios do
desc "Runs all the tests"
lane :test do
# Run all tests in the scheme named "Scrawl"
run_tests(scheme: "Scrawl")
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
# Download signing credentials from ADC
get_certificates
get_provisioning_profile(
app_identifier: "com.cocoatype.Scratch",
filename: "app.mobileprovision",
platform: "ios")
get_provisioning_profile(
app_identifier: "com.cocoatype.Scratch.Widget",
filename: "widget.mobileprovision",
platform: "ios")
get_provisioning_profile(
app_identifier: "com.cocoatype.Scratch.Intent",
filename: "intent.mobileprovision",
platform: "ios")
# Update the Xcode project with the correct signing credentials
disable_automatic_code_signing
update_project_provisioning(
build_configuration: "Release",
target_filter: "Scrawl",
profile: "./app.mobileprovision")
update_project_provisioning(
build_configuration: "Release",
target_filter: "Widget",
profile: "./widget.mobileprovision")
update_project_provisioning(
build_configuration: "Release",
target_filter: "Intent",
profile: "./intent.mobileprovision")
# Set the build number to the number of Git commits
build_number = sh "git log --oneline --no-merges | wc -l"
increment_build_number(build_number: build_number)
# Build the app for App Store
build_app(
export_method: "app-store",
scheme: "Scrawl")
# Just upload the build to TestFlight, no other changes
upload_to_testflight(
app_platform: "ios",
skip_submission: true,
skip_waiting_for_build_processing: true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment