Skip to content

Instantly share code, notes, and snippets.

Avatar

Shafayat Hossain shafayathossain

  • Dhaka, Bangladesh
View GitHub Profile
@shafayathossain
shafayathossain / Android ci-cd-workflow.yml
Created Dec 3, 2021
Complete workflow file to getting started with CI/CD for Android project
View Android ci-cd-workflow.yml
name: CI/CD workflow
on: push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
@shafayathossain
shafayathossain / Run Fastlane Project.yml
Last active Dec 3, 2021
Step to run Fastlane Project from Github Workflow
View Run Fastlane Project.yml
- name: Build and distribute app
run: |
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
git config --global user.email ${{github.event.pusher.email}}
git config --global user.name ${{github.event.pusher.name}}
bundle exec fastlane build_and_distribute
@shafayathossain
shafayathossain / Cache dependencies.yml
Created Dec 3, 2021
Step to cache Ruby dependencies and Gradle packages
View Cache dependencies.yml
- name: Cache Ruby dependencies
uses: actions/cache@v2
with:
path: 'vendor/bundle'
key: ${{ runner.os }}-gems-${{ secrets.GEMS_CACHE_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Cache Gradle packages
uses: actions/cache@v2
with:
View Checkout Github Repository Step.yml
- name; Checkout the repository
uses: actions/checkout@v2
with: fetch-depth: 0
@shafayathossain
shafayathossain / Base Structure of Workflow File.yml
Created Dec 3, 2021
Base structure of a github workflow file.
View Base Structure of Workflow File.yml
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.
@shafayathossain
shafayathossain / Fastfile
Created Dec 1, 2021
Final fastfile for integrating continuous delivery using fastlane
View Fastfile
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
@shafayathossain
shafayathossain / Fastfile build_and_distribute.rb
Created Dec 1, 2021
Responsible for test, build and upload bundle to firebase app distribution and playstore by calling other private lanes.
View Fastfile build_and_distribute.rb
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
@shafayathossain
shafayathossain / Fastfile after_all.rb
Created Dec 1, 2021
After successful execution of all task, this block is called
View Fastfile after_all.rb
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",
@shafayathossain
shafayathossain / Fastfile distribute_playstore.rb
Created Dec 1, 2021
Responsible for uploading aab to playstore
View Fastfile distribute_playstore.rb
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
@shafayathossain
shafayathossain / Fastfile distribute_to_firebase.rb
Created Dec 1, 2021
Responsible for uploading .aab to Firebase app distribution.
View Fastfile distribute_to_firebase.rb
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"
)