Skip to content

Commit

Permalink
Update firebase distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarwillymc committed Jan 19, 2024
1 parent 5a85ab0 commit dfd4fca
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 45 deletions.
47 changes: 19 additions & 28 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android MBCGroup CI
name: Generate Debug

on:
push:
Expand All @@ -9,18 +9,9 @@ on:
- develop

jobs:

build:
config:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
env:
SHARED_PREFERENCES_NAME: ${{ secrets.SHARED_PREFERENCES_NAME }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_URL_GQL: ${{ secrets.BASE_URL_GQL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
TESTERS_GROUP: ${{ secrets.TESTERS_GROUP }}

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -42,27 +33,27 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew

validations:
runs-on: ubuntu-latest
steps:
- name: Execute validations
run: ./gradlew executeValidations

- name: Generate app and firebase distribution
build:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- name: Build App
run: ./gradlew assembleDebug appDistributionUploadDebug

env:
SHARED_PREFERENCES_NAME: ${{ secrets.SHARED_PREFERENCES_NAME }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_URL_GQL: ${{ secrets.BASE_URL_GQL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
TESTERS_GROUP: ${{ secrets.TESTERS_GROUP }}
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk

#
# - name: Build App
# run: |
# if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
# ./gradlew assembleRelease
# else
# ./gradlew assembleDebug
# fi
#


33 changes: 18 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android MBCGroup CI
name: Generate Release

on:
push:
Expand All @@ -9,18 +9,9 @@ on:
- main

jobs:

build:
config:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
env:
SHARED_PREFERENCES_NAME: ${{ secrets.SHARED_PREFERENCES_NAME }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_URL_GQL: ${{ secrets.BASE_URL_GQL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
TESTERS_GROUP: ${{ secrets.TESTERS_GROUP }}

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -42,13 +33,25 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew

validations:
runs-on: ubuntu-latest
steps:
- name: Execute validations
run: ./gradlew executeValidations

build:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- name: Build App
run: ./gradlew assembleRelease appDistributionUploadRelease

env:
SHARED_PREFERENCES_NAME: ${{ secrets.SHARED_PREFERENCES_NAME }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_URL_GQL: ${{ secrets.BASE_URL_GQL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
TESTERS_GROUP: ${{ secrets.TESTERS_GROUP }}
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
Expand All @@ -8,8 +10,7 @@ plugins {
kotlin("kapt")
}

private val localProperties =
com.android.build.gradle.internal.cxx.configure.gradleLocalProperties(rootDir)
private val localProperties = gradleLocalProperties(rootDir)

fun getLocalProperty(key: String, defaultValue: String = ""): String =
localProperties.getProperty(key, System.getenv(key) ?: defaultValue)
Expand Down

0 comments on commit dfd4fca

Please sign in to comment.