Skip to content

Support 2 build flavors: Github and GooglePlay. #276

Support 2 build flavors: Github and GooglePlay.

Support 2 build flavors: Github and GooglePlay. #276

Workflow file for this run

name: Build the app
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BRANCH_NAME: ${{ github.ref_name }}
jobs:
check:
if: ${{ startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Build debug APK
run: ./gradlew assembleDebug
build:
if: ${{ ! startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Decrypt the keystore for signing
run: |
echo "${{ secrets.KEYSTORE_ENCRYPTED }}" > keystore.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.asc > keystore.jks
- name: Build release APK
run: ./gradlew assembleRelease
- name: Upload release Github arm64-v8a APK
uses: actions/upload-artifact@v4
with:
name: release-arm64-v8a-apk-github
path: ./app/build/outputs/apk/github/release/app-github-arm64-v8a-release.apk
- name: Upload release Github armeabi-v7a APK
uses: actions/upload-artifact@v4
with:
name: release-armeabi-v7a-apk-github
path: ./app/build/outputs/apk/github/release/app-github-armeabi-v7a-release.apk
- name: Upload release Github universal APK
uses: actions/upload-artifact@v4
with:
name: release-universal-apk-github
path: ./app/build/outputs/apk/github/release/app-github-universal-release.apk
- name: Upload release GooglePlay arm64-v8a APK
uses: actions/upload-artifact@v4
with:
name: release-arm64-v8a-apk-googleplay
path: ./app/build/outputs/apk/googleplay/release/app-googleplay-arm64-v8a-release.apk
- name: Upload release GooglePlay armeabi-v7a APK
uses: actions/upload-artifact@v4
with:
name: release-armeabi-v7a-apk-googleplay
path: ./app/build/outputs/apk/googleplay/release/app-googleplay-armeabi-v7a-release.apk
- name: Upload release GooglePlay universal APK
uses: actions/upload-artifact@v4
with:
name: release-universal-apk-googleplay
path: ./app/build/outputs/apk/googleplay/release/app-googleplay-universal-release.apk
lint:
needs: build
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Run linter
run: ./gradlew lint
- uses: actions/upload-artifact@v4
with:
name: lint-results
path: ./app/build/reports/*.html
ktlint:
needs: build
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Kotlin linter
run: ./gradlew ktlintCheck