This file contains 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
fastlane_require "dotenv" | |
PACKAGE_NAME = "<package name here>" | |
FIREBASE_APP_ID = "<firebase app id here>" | |
KEYSTORE_PATH = nil | |
FIREBASE_KEY_PATH = nil | |
PLAYSTORE_KEY_PATH = nil | |
BUNDLE_FILE_PATH = nil | |
UPDATED_VERSION_CODE = nil | |
before_all do | |
Dotenv.overload ".env.secret" |
This file contains 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
desc "Responsible for fetching version code from play console and incrementing version code." | |
lane :increment_version_code_in_project_gradle do | |
version_code_from_play_store_strings = google_play_track_version_codes( | |
package_name: PACKAGE_NAME, # PACKAGE_NAME is a global variable defined earlier | |
track: "production", # this can be alpha, beta etc. | |
json_key: PLAYSTORE_KEY_PATH, | |
) | |
version_code_from_play_store = version_code_from_play_store_strings[0].to_i | |
UPDATED_VERSION_CODE = version_code_from_play_store + 1 | |
increment_version_code( |
This file contains 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
desc "Run unit tests." | |
lane :run_unit_tests do | |
gradle( | |
task: "test" | |
) | |
end |
This file contains 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
desc "Build the .aab file" | |
lane :build do | |
gradle( | |
task: "bundle", | |
build_type: "Release", | |
properties: { | |
"android.injected.signing.store.file" => KEYSTORE_PATH, | |
"android.injected.signing.store.password" => ENV['KEYSTORE_PASSWORD'], | |
"android.injected.signing.key.alias" => ENV['KEYSTORE_ALIAS'], | |
"android.injected.signing.key.password" => ENV['KEYSTORE_PASSWORD'] |
This file contains 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
desc "Responsible for uploading .aab to Firebase app distribution." | |
lane :distribute_to_firebase do | |
firebase_app_distribution( | |
app: FIREBASE_APP_ID, | |
release_notes: "Uploaded from CI/CD", | |
android_artifact_type: "AAB", | |
android_artifact_path: BUNDLE_FILE_PATH, | |
service_credentials_file: FIREBASE_KEY_PATH, | |
groups: "tester-team" | |
) |
This file contains 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
desc "Responsible for uploading aab to playstore" | |
lane :distribute_playstore do | |
upload_to_play_store( | |
track: "production", | |
aab: BUNDLE_FILE_PATH, | |
json_key: PLAYSTORE_KEY_PATH, | |
package_name: PACKAGE_NAME | |
) | |
end |
This file contains 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
desc "After successful execution of all task, this block is called" | |
after_all do | |
git_add(path: "*") | |
git_commit( | |
path: "*", | |
message: "#" + UPDATED_VERSION_CODE + " released" | |
) | |
push_to_git_remote( | |
local_branch: buildConfigs.key(options[:buildConfig]), | |
remote: "origin", |
This file contains 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
desc "Responsible for testing, building and uploading bundle to firebase app distribution and playstore by calling other private lanes." | |
lane build_and_distribute: | |
increment_version_code_in_project_gradle() | |
run_unit_tests() | |
build() | |
distribute_to_firebase() | |
distribute_playstore() | |
end |
This file contains 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
fastlane_require "dotenv" | |
PACKAGE_NAME = "<package name here>" | |
FIREBASE_APP_ID = "<firebase app id here>" | |
KEYSTORE_PATH = nil | |
FIREBASE_KEY_PATH = nil | |
PLAYSTORE_KEY_PATH = nil | |
BUNDLE_FILE_PATH = nil | |
UPDATED_VERSION_CODE = nil |
This file contains 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
name: CI workflow | |
# Events when the workflow will dispatch/run. | |
on: push | |
jobs: | |
# Define jobs and their steps that will be executed. | |
deploy: | |
steps: | |
# Define steps to complete the current job. |
OlderNewer