Skip to content

Instantly share code, notes, and snippets.

View DarshReddy's full-sized avatar
💤
Dreaming

Darsh DarshReddy

💤
Dreaming
View GitHub Profile
@DarshReddy
DarshReddy / Dangerfile
Last active August 26, 2023 08:56
Danger File
# Warn when there is a big PR
warn("Big PR!") if git.lines_of_code > 500
# Android lint
android_lint.severity = "Warning"
android_lint.skip_gradle_task = true
#lint only on modified lines
android_lint.filtering_lines = true
@DarshReddy
DarshReddy / BumpVersionCode.py
Created August 5, 2023 15:01
Bump Version Code Script
import fileinput
def bump_version_code():
with open('<path to file with version code>', 'r') as appConfigFile:
for line in appConfigFile.readlines():
new_words = line.strip().split(' ')
words = line.strip().split(' ')
if '<version code variable identifier>' in words:
new_words[-1] = str(int(words[-1]) + 1)
@DarshReddy
DarshReddy / BumpVersionName.py
Last active August 5, 2023 15:03
Bump Version Name Script
import sys
import fileinput
def bump_version_name(version_code):
with open('<path to file with version name>', 'r') as appConfigFile:
for line in appConfigFile.readlines():
new_words = line.strip().split(' ')
words = line.strip().split(' ')
if '<version name variable identifier>' in words:
@DarshReddy
DarshReddy / Jenkinsfile
Created June 26, 2023 04:53
Example Jenkinsfile for an Android CI/CD pipeline
pipeline {
agent {
label "<your node label>"
}
environment {
DANGER_GITHUB_API_TOKEN = credentials('Token') // token for using GitHub APIs create using - https://docs.github.com/en/enterprise-server@3.4/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
CREDENTIALS_ID = '<your credential id>' // the one you created in step 3
BUCKET = '<your config files bucket>' // bucket name you added the files in cloud project
FOLDER = '<folder name>' // folder name where you added the files in cloud project
SDK_URL= 'https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip' // link to download latest cmd line tools
@DarshReddy
DarshReddy / Fastfile
Created June 26, 2023 04:53
Example Fastfile for an Android CI/CD pipeline
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins