Last active
March 30, 2020 09:28
-
-
Save GabLeRoux/77322cc02d02c22693ce17cc74468ce1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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