Skip to content

Commit

Permalink
Add build_lint workflow and refactor internal_release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliyan Germanov committed Nov 4, 2021
1 parent 184e70b commit e96d7b0
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 37 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Lint

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:

#Triggers when a pull request event occurs (opened, synchronize, reopened)
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout GIT
uses: actions/checkout@v2
with:
fetch-depth: 0 #Fetch all history for all branches and tags

- name: Setup Java SDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'

- name: Setup Ruby (for Fastlane)
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Install Fastlane
run: bundle install
#----------------------------------------------------

#Security
- name: Validate Gradle Wrapper checksum
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle Wrapper (gradlew) executable
run: chmod +x gradlew
#----------------------------------------------------

#Optimization
- name: Enable Gradle Wrapper caching (optmization)
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
#---------------------------------------------------

#Fastlane: Verifies that the project builds and that Lint checks are passing
- name: Fastlane build_lint (Build DEBUG + Lint DEBUG)
run: bundle exec fastlane build_lint
#--------------------------------------------------------------------------
4 changes: 1 addition & 3 deletions .github/workflows/internal_release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# This is a basic workflow to help you get started with Actions

name: Internal Release

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
# Triggers the workflow on push of version tag
push:
tags:
- 'v*'
Expand Down
81 changes: 47 additions & 34 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,51 @@
default_platform(:android)

platform :android do
desc "Builds release app bundle (AAB) for the Google Play Store."
lane :production_build do
#gradle(
# task: "testDebugUnitTest"
#)

gradle(
task: "clean"
)

gradle(
task: "lint",
build_type: "Release"
)

gradle(
task: "bundle",
build_type: "Release"
)
end

desc "Releases a generated AAB to Google PlayStore's Internal Testing"
lane :internal_release do
supply(
track: "internal",
aab: "app/build/outputs/bundle/release/app-release.aab",
release_status: "draft",
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: false,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
desc "Tries to build the project and then runs Lint checks for Debug"
lane :build_lint do
gradle(
task: "build",
build_type: "Debug"
)

gradle(
task: "lint",
build_type: "Debug"
)
end

desc "Builds release app bundle (AAB) for the Google Play Store."
lane :production_build do
#gradle(
# task: "testDebugUnitTest"
#)

gradle(
task: "clean"
)

gradle(
task: "lint",
build_type: "Release"
)

gradle(
task: "bundle",
build_type: "Release"
)
end

desc "Releases a generated AAB to Google PlayStore's Internal Testing"
lane :internal_release do
supply(
track: "internal",
aab: "app/build/outputs/bundle/release/app-release.aab",
release_status: "draft",
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: false,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
end

0 comments on commit e96d7b0

Please sign in to comment.