Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #8

Merged
merged 64 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5a85ab0
Integrate Github Actions with firebase distributions
cesarwillymc Jan 19, 2024
dfd4fca
Update firebase distribution.
cesarwillymc Jan 19, 2024
6dfcc10
Update debug.yml
cesarwillymc Jan 19, 2024
1756e67
Update debug.yml
cesarwillymc Jan 19, 2024
5e7bbdc
Update debug.yml
cesarwillymc Jan 19, 2024
050c204
Update debug.yml
cesarwillymc Jan 19, 2024
2e8abeb
Update debug.yml
cesarwillymc Jan 19, 2024
9274c03
Update debug.yml
cesarwillymc Jan 19, 2024
fdf98ab
Update debug.yml
cesarwillymc Jan 19, 2024
5cdde7c
Update debug.yml
cesarwillymc Jan 19, 2024
ed24ebe
Update debug.yml
cesarwillymc Jan 19, 2024
28d09f4
Update build.gradle.kts
cesarwillymc Jan 19, 2024
82b3b86
Update firebase firestribution
cesarwillymc Jan 19, 2024
830dbc9
Update debug.yml
cesarwillymc Jan 19, 2024
fda202e
Update debug.yml
cesarwillymc Jan 19, 2024
6cee7c3
Update debug yml
cesarwillymc Jan 19, 2024
c114027
Update debug.yml
cesarwillymc Jan 19, 2024
f21a825
Update firebase distribution
cesarwillymc Jan 19, 2024
81d56db
Update release notes and Json
cesarwillymc Jan 19, 2024
5db6263
Update debug.yml
cesarwillymc Jan 19, 2024
9fb028b
Update debug.yml
cesarwillymc Jan 19, 2024
40e1d32
Update debug.yml
cesarwillymc Jan 19, 2024
4e32db9
Update debug.yml
cesarwillymc Jan 19, 2024
4ef1191
Update debug.yml
cesarwillymc Jan 19, 2024
633cf20
Update debug.yml
cesarwillymc Jan 19, 2024
af2ff1c
Update debug.yml
cesarwillymc Jan 19, 2024
20264fa
Update debug.yml
cesarwillymc Jan 19, 2024
43bb153
Update debug.yml
cesarwillymc Jan 19, 2024
fb16549
Update debug.yml
cesarwillymc Jan 19, 2024
9b6a014
Update debug.yml
cesarwillymc Jan 19, 2024
f0d05a3
Update debug.yml
cesarwillymc Jan 19, 2024
83b992f
Update debug.yml
cesarwillymc Jan 19, 2024
82925df
Update debug.yml
cesarwillymc Jan 19, 2024
a156b1f
Update debug.yml
cesarwillymc Jan 19, 2024
137a626
Update debug.yml
cesarwillymc Jan 19, 2024
f2cdd0d
Update debug.yml
cesarwillymc Jan 19, 2024
4f83615
Update debug.yml
cesarwillymc Jan 19, 2024
8bf1fa0
Update debug.yml
cesarwillymc Jan 19, 2024
3806959
Update debug.yml
cesarwillymc Jan 19, 2024
fdc899f
Update debug.yml
cesarwillymc Jan 19, 2024
776a74f
Update debug.yml
cesarwillymc Jan 19, 2024
35022a8
Update debug.yml
cesarwillymc Jan 19, 2024
046972c
Update debug.yml
cesarwillymc Jan 19, 2024
7a510d5
Update debug.yml
cesarwillymc Jan 19, 2024
21d8720
Update debug.yml
cesarwillymc Jan 19, 2024
89cf126
Update debug.yml
cesarwillymc Jan 19, 2024
dd2f583
Update debug.yml
cesarwillymc Jan 19, 2024
e4a2a7f
Update debug.yml
cesarwillymc Jan 19, 2024
ed1cdd6
Update debug.yml
cesarwillymc Jan 19, 2024
f801af7
Update debug.yml
cesarwillymc Jan 19, 2024
7141849
Update debug.yml
cesarwillymc Jan 19, 2024
7e238ab
Update debug.yml
cesarwillymc Jan 19, 2024
5e46348
Update debug.yml
cesarwillymc Jan 19, 2024
4d3ea53
Update debug.yml
cesarwillymc Jan 19, 2024
7cec76c
Update debug.yml
cesarwillymc Jan 19, 2024
8439311
Update debug.yml
cesarwillymc Jan 19, 2024
74cd1db
Update debug.yml
cesarwillymc Jan 19, 2024
08c0f66
Update debug.yml
cesarwillymc Jan 19, 2024
f0dcc8c
Update debug.yml
cesarwillymc Jan 19, 2024
454d305
Update debug.yml
cesarwillymc Jan 19, 2024
30935e9
Update release node
cesarwillymc Jan 19, 2024
45106db
Update build.gradle.kts
cesarwillymc Jan 19, 2024
f5ac055
Update build.gradle.kts
cesarwillymc Jan 19, 2024
5055b81
Update debug.yml
cesarwillymc Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions .github/workflows/cd.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Generate Debug

on:
push:
branches:
- develop
pull_request:
branches:
- develop
workflow_dispatch:
inputs:
buildType:
description: 'Build Type'
required: true
default: 'debug'
type: choice
options:
- debug
- release
groupTester:
description: 'Testers'
required: true
default: 'qa'
type: choice
options:
- all
- qa
- production
releaseNotes:
description: 'Release notes'
required: true
default: 'Update'
type: string

jobs:
generation:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Set up Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create Google Services File
run: cat /home/runner/work/MBCGroup/MBCGroup/app/google-services.json | base64
- name: Add data Google Services File
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/MBCGroup/MBCGroup/app/google-services.json
- name: Configuration Local.properties
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 }}
run: |
echo "SHARED_PREFERENCES_NAME=$SHARED_PREFERENCES_NAME" >> local.properties
echo "BASE_URL=$BASE_URL" >> local.properties
echo "BASE_URL_GQL=$BASE_URL_GQL" >> local.properties
echo "CLIENT_ID=$CLIENT_ID" >> local.properties
echo "CLIENT_SECRET=$CLIENT_SECRET" >> local.properties
- name: Set RELEASE_NOTE
id: set_release_note
run: |
if [ -z "${{ inputs.releaseNotes }}" ]; then
RELEASE_NOTE=$(cat release_notes.txt)
else
RELEASE_NOTE="${{ inputs.releaseNotes }}"
fi
echo "RELEASE_NOTE_TEXT<<EOF" >> $GITHUB_ENV
echo $RELEASE_NOTE >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Set App ID
id: set_app_id
run: |
if [[ "${{ inputs.buildType || 'debug' }}" == "debug" ]]; then
echo "APP_ID=${{ secrets.APP_ID_DEBUG }}" >> $GITHUB_ENV
else
echo "APP_ID=${{ secrets.APP_ID_RELEASE }}" >> $GITHUB_ENV
fi
- name: Execute validations
run: ./gradlew executeValidations
- name: Build App Release
if: ${{ inputs.buildType || 'debug' }} != "debug"
run: ./gradlew assembleRelease
env:
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
- name: Build App Debug
if: ${{ inputs.buildType || 'debug' }} == "debug"
run: ./gradlew assembleDebug
env:
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
- name: Upload Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ env.APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_TOKEN }}
groups: ${{ inputs.groupTester || 'qa' }}
releaseNotes: ${{ env.RELEASE_NOTE_TEXT }}
file: app/build/outputs/apk/${{ inputs.buildType || 'debug' }}/app-${{ inputs.buildType || 'debug' }}.apk
debug: true
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: app-${{ inputs.buildType || 'debug' }}
path: app/build/outputs/apk/${{ inputs.buildType || 'debug' }}/app-${{ inputs.buildType || 'debug' }}.apk
122 changes: 122 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Generate Release

on:
workflow_dispatch:
inputs:
buildType:
description: 'Build Type'
required: true
default: 'release'
type: choice
options:
- debug
- release
groupTester:
description: 'Testers'
required: true
default: 'production'
type: choice
options:
- all
- qa
- production
releaseNotes:
description: 'Release notes'
required: true
default: 'Update'
type: string
push:
branches:
- main
pull_request:
branches:
- main

jobs:
generation:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Set up Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create Google Services File
run: cat /home/runner/work/MBCGroup/MBCGroup/app/google-services.json | base64
- name: Add data Google Services File
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/MBCGroup/MBCGroup/app/google-services.json
- name: Configuration Local.properties
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 }}
run: |
echo "SHARED_PREFERENCES_NAME=$SHARED_PREFERENCES_NAME" >> local.properties
echo "BASE_URL=$BASE_URL" >> local.properties
echo "BASE_URL_GQL=$BASE_URL_GQL" >> local.properties
echo "CLIENT_ID=$CLIENT_ID" >> local.properties
echo "CLIENT_SECRET=$CLIENT_SECRET" >> local.properties
- name: Set RELEASE_NOTE
id: set_release_note
run: |
if [ -z "${{ inputs.releaseNotes }}" ]; then
RELEASE_NOTE=$(cat release_notes.txt)
else
RELEASE_NOTE="${{ inputs.releaseNotes }}"
fi
echo "RELEASE_NOTE_TEXT<<EOF" >> $GITHUB_ENV
echo $RELEASE_NOTE >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Set App ID
id: set_app_id
run: |
if [[ "${{ inputs.buildType || 'release' }}" == "release" ]]; then
echo "APP_ID=${{ secrets.APP_ID_RELEASE }}" >> $GITHUB_ENV
else
echo "APP_ID=${{ secrets.APP_ID_DEBUG }}" >> $GITHUB_ENV
fi
- name: Execute validations
run: ./gradlew executeValidations
- name: Build App Release
if: ${{ inputs.buildType || 'release' }} == "release"
run: ./gradlew assembleRelease
env:
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
- name: Build App Debug
if: ${{ inputs.buildType || 'release' }} != "release"
run: ./gradlew assembleDebug
env:
DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
- name: Upload Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ env.APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_TOKEN }}
groups: ${{ inputs.groupTester || 'production' }}
releaseNotes: ${{ env.RELEASE_NOTE_TEXT }}
file: app/build/outputs/apk/${{ inputs.buildType || 'release' }}/app-${{ inputs.buildType || 'release' }}.apk
debug: true
- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: app-${{ inputs.buildType || 'release' }}
path: app/build/outputs/apk/${{ inputs.buildType || 'release' }}/app-${{ inputs.buildType || 'release' }}.apk
12 changes: 10 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.dagger.hilt.android")
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
id("com.apollographql.apollo3").version("3.7.3")
id("com.google.firebase.appdistribution")
kotlin("kapt")
id("com.google.gms.google-services")
}

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 Expand Up @@ -58,6 +61,7 @@ android {
}
debug {
signingConfig = signingConfigs.getByName("debug")
applicationIdSuffix = ".debug"
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
Expand Down Expand Up @@ -85,6 +89,10 @@ android {
}
}
}
configure<com.google.firebase.appdistribution.gradle.AppDistributionExtension> {
releaseNotesFile = "${projectDir}/../release_notes.txt"
groups = getLocalProperty("TESTERS_GROUP", "")
}

dependencies {

Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ plugins {
id("com.github.ben-manes.versions") version "0.39.0"
id("com.google.dagger.hilt.android") version "2.48" apply false
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false

}
buildscript {
dependencies {
classpath("com.google.gms:google-services:4.4.0")
classpath("com.android.tools.build:gradle:8.1.0")
classpath("com.google.firebase:firebase-appdistribution-gradle:4.0.1")
}
}

allprojects {
apply(plugin = "org.jmailen.kotlinter")
apply(plugin = "io.gitlab.arturbosch.detekt")
Expand Down
3 changes: 3 additions & 0 deletions release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPRINT 1:
- SM-1324 Android - Ocultar pestañas sin información en PDP
- SM-1358 Android - Habilitar Mi Cuenta en Ecuador
Loading