-
Notifications
You must be signed in to change notification settings - Fork 4
Fastlane #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tinypell3ts
wants to merge
10
commits into
main
Choose a base branch
from
fastlane
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fastlane #125
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3d8ccb6
prompt user to install fastlane, run script if true.
aae9fe1
fastlane script
637bedb
fix prompting
e17c68f
remove unnecessary commands
d1e60d8
new approach
9468a83
add skip build
4f78994
allow android/ios only, and build skipping
19d5a7b
change debug to release in firebase release lane
2606b97
update env variable checkpoints
5e063c2
Merge branch 'master' into fastlane
craigcoles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # check if fastlane is installed | ||
| isInstalled() { | ||
| if hash fastlane 2>/dev/null; then | ||
| echo "Fastlane already installed!" | ||
| else | ||
| echo "How do you want to install Fastlane?" | ||
| select yn in "RubyGems" "Homebrew"; do | ||
| case $yn in | ||
| RubyGems ) echo "Installing Fastlane via RubyGems (you maybe asked for a password)... "; sudo gem install fastlane -NV ; break;; | ||
| Homebrew ) echo "Installing Fastlane via Homebrew..."; brew install fastlane ; break;; | ||
| esac | ||
| done | ||
| fi | ||
| }; | ||
|
|
||
| isInstalled; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Version Bump | ||
| GITHUB_TOKEN= | ||
| REPO_NAME= | ||
|
|
||
| # Github Release | ||
| CODESIGNING_IDENTITY= | ||
|
|
||
| # Firebase Release | ||
| IOS_APP_ID= | ||
| ANDROID_APP_ID= | ||
| SLACK_URL= | ||
| TESTERS= |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #IOS config | ||
| # app_identifier "com.app.identifier" # The bundle identifier of your app | ||
| # apple_id "apple@id.co.uk"# Your Apple email address | ||
| # team_name "TEAM NAME"# Team name for your itunes connect account | ||
| # team_id "TEAMID" # Team ID for your itunes connect account - found at https://developer.apple.com/account/#/membership/S7R8RC82YA | ||
| # itc_team_name "TEAM NAME"# Team name for your itunes connect account | ||
| # itc_team_id "TEAM ID"# Team ID for your itunes connect account | ||
|
|
||
| # Android config | ||
| # json_key_file "./path-to-json-key.json"# JSON key generated for the android play store account instructions for creating at: https://docs.fastlane.tools/getting-started/android/setup/#collect-your-google-credentials | ||
| # package_name "com.android.package.id" # Application id for the android app found in build.gradle fil# |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # Customise this file, documentation can be found here: | ||
| # https://github.com/fastlane/fastlane/tree/master/fastlane/docs | ||
| # All available actions: https://docs.fastlane.tools/actions | ||
| # 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 "2.28.3" | ||
|
|
||
| # Check that there is nothing to commit and pull the latest repo. | ||
| before_all do | ||
| ensure_git_branch | ||
| ensure_git_status_clean | ||
| git_pull | ||
| end | ||
|
|
||
| package = load_json(json_path: "./package.json") | ||
| appname = package["name"] | ||
| version = package["version"] | ||
|
|
||
| #################### | ||
| ### TEST LANE ### | ||
| #################### | ||
| lane :test_setup do | ||
| puts('FASTLANE CORRECTLY SETUP 🔥') | ||
| end | ||
|
|
||
| #################### | ||
| ### VERSION BUMP ### | ||
| #################### | ||
| lane :version_bump do | ||
| increment_version_number(version_number: package["version"], xcodeproj: "ios/#{appname}.xcodeproj") | ||
| commit_version_bump(message: "Release v#{version} :rocket:", xcodeproj: "ios/#{appname}.xcodeproj") | ||
| push_to_git_remote( | ||
| remote: "origin", | ||
| tags: false, | ||
| no_verify: true | ||
| ) | ||
| end | ||
|
|
||
| ###################### | ||
| ### GITHUB RELEASE ### | ||
| ###################### | ||
| lane :github_release do | ||
| ensure_env_vars( | ||
| env_vars: ['CODESIGNING_IDENTITY', 'GITHUB_TOKEN'] | ||
| ) | ||
|
|
||
| ## BUILD IOS | ||
| build_ios_app( | ||
| workspace: "ios/#{appname}.xcworkspace", | ||
| output_directory: "builds/v#{version}", | ||
| export_options: { method: "app-store" }, | ||
| codesigning_identity: ENV['CODESIGNING_IDENTITY'] | ||
| ) | ||
|
|
||
| ## BUILD ANDROID | ||
| gradle(task: 'clean', project_dir: 'android/') | ||
| gradle(task: 'bundle', build_type: 'Release', project_dir: 'android/') | ||
|
|
||
| ## ADD TO GITHUB | ||
| set_github_release( | ||
| repository_name: "simpleweb/#{ENV['REPO_NAME']}", | ||
| api_token: ENV['GITHUB_TOKEN'], | ||
| name: "#{version}", | ||
| tag_name: "v#{version}", | ||
| description: "Add release notes here...", | ||
| commitish: "master", | ||
| is_prerelease: true, | ||
| upload_assets: ["builds/v#{version}/#{appname}.ipa", "android/app/build/outputs/bundle/release/app.aab"] | ||
| ) | ||
| end | ||
|
|
||
| ############################# | ||
| ### FIREBASE BETA RELEASE ### | ||
| ############################# | ||
| lane :firebase_release do |options| | ||
| ensure_env_vars( | ||
| env_vars: ['IOS_APP_ID', 'ANDROID_APP_ID', 'TESTERS'] | ||
| ) | ||
|
|
||
| ## SEND SLACK NOTIFICATION | ||
| if ENV['SLACK_URL'] | ||
| slack( | ||
| slack_url: ENV['SLACK_URL'], | ||
| message: "A beta release of #{appname}(v#{version}) is being uploaded to Firebase..." | ||
| ) | ||
| end | ||
|
|
||
| ## BUILD IOS unless skip_build:true | ||
| unless options[:skip_build] | ||
| build_ios_app( | ||
| workspace: "ios/#{appname}.xcworkspace", | ||
| output_directory: "builds/v#{version}", | ||
| export_options: { method: "app-store" }, | ||
| codesigning_identity: ENV['CODESIGNING_IDENTITY'] | ||
| ) | ||
| end | ||
|
|
||
| ## UPLOAD IPA | ||
| puts "-------------------------------------------------------" | ||
| puts "--- Uploading #{appname}(v#{version}) IPA to Firebase ---" | ||
| puts "-------------------------------------------------------" | ||
| firebase_app_distribution( | ||
| app: ENV['IOS_APP_ID'], | ||
| ipa_path: "builds/v#{version}/#{appname}.ipa", | ||
| testers: ENV['TESTERS'], | ||
| release_notes: "Add release notes here...", | ||
| firebase_cli_path: "/usr/local/bin/firebase" | ||
| ) | ||
|
|
||
| ## UPLOAD APK | ||
| puts "-------------------------------------------------------" | ||
| puts "--- Uploading #{appname}(v#{version}) APK to Firebase ---" | ||
| puts "-------------------------------------------------------" | ||
| firebase_app_distribution( | ||
| app: ENV['ANDROID_APP_ID'], | ||
| apk_path: "android/app/build/outputs/apk/debug/app-debug.apk", | ||
|
||
| testers: ENV['TESTERS'], | ||
| release_notes: "Add release notes here...", | ||
| firebase_cli_path: "/usr/local/bin/firebase" | ||
| ) | ||
|
|
||
| ## SEND SLACK NOTIFICATION | ||
| if ENV['SLACK_URL'] | ||
| slack( | ||
| slack_url: ENV['SLACK_URL'], | ||
| message: "A beta release of #{appname}(v#{version}) is now available for testing on Firebase" | ||
| ) | ||
| end | ||
| end | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Autogenerated by fastlane | ||
| # | ||
| # Ensure this file is checked in to source control! | ||
|
|
||
| gem 'fastlane-plugin-firebase_app_distribution' | ||
| gem 'fastlane-plugin-load_json' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path would fail if you didn't run the
github_releaselane first. Needs a re-think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now added a
skip_buildoption. This means the iOS version will re-build unless you add theskip_buildparameter.yarn run firebase:release skip_build:true.