Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.106.2"
default_platform :ios
# Note: this fastfile assumes the ios build is generated in the following folder: `./builds/ios/`
platform :ios do
before_all do
# set SLACK_URL from environment variable directly instead ;)
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ"
# Here's a way to set `ITSAppUsesNonExemptEncryption` from command line using `PlistBuddy`
# There's probably a way to do this in unity as well (or it's already done in latest unity versions?)
sh 'cd .. && /usr/libexec/PlistBuddy -c "Add :ITSAppUsesNonExemptEncryption bool false" builds/ios/Info.plist || true'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Set :ITSAppUsesNonExemptEncryption bool false" builds/ios/Info.plist'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Add :NSCameraUsageDescription string unused" builds/ios/Info.plist || true'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Set :NSCameraUsageDescription string unused" builds/ios/Info.plist'
end
desc "Runs all the tests"
lane :test do
# TODO: run unity tests? That would be awesome
scan
end
desc "Increments build number based on latest testflight build using Appfile app_identifier"
lane :increment do
increment_build_number({
xcodeproj: 'build/ios/Unity-iPhone.xcodeproj',
build_number: latest_testflight_build_number(
app_identifier: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
) + 1
})
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
# match(type: "appstore") # more information: https://codesigning.guide
# passing workspace parameter as unity generates its ios build in a different folder
gym({
scheme: "Unity-iPhone",
workspace: 'builds/ios/Unity-iPhone.xcworkspace',
})
pilot
# sh "your_script.sh"
# You can also use other beta testing services here (run `fastlane actions`)
end
desc "Deploy a new version to the App Store"
lane :release do
# match(type: "appstore")
# snapshot
# passing workspace parameter as unity generates its ios build in a different folder
gym({
scheme: "Unity-iPhone",
workspace: 'builds/ios/Unity-iPhone.xcworkspace',
})
# will release the game, watchout!
deliver(force: true)
end
after_all do |lane|
# This block is called, only if the executed lane was successful
slack(
message: "Successfully executed."
)
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# fastlane reports which actions are used
# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment