Skip to content

Commit

Permalink
Merge pull request #3633 from vpPavithra/release-8.0.0_capacitor
Browse files Browse the repository at this point in the history
Issue #ED-0000 feat: Added git actions
  • Loading branch information
swayangjit authored Jun 20, 2024
2 parents 94bc672 + 93d2728 commit a4a0197
Show file tree
Hide file tree
Showing 16 changed files with 26,875 additions and 24,227 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Android

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
build:
environment: sunbird
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install Ionic
run: npm install -g @ionic/cli

# - name: Install app dependencies
# run: npm install

# - name: Convert Windows line endings to Linux from the gradlew file
# run: sudo apt update && sudo apt install dos2unix && cd android && dos2unix ./gradlew && cd ..

# - name: Make ./gradlew command executable
# run: cd android && chmod +x ./gradlew && cd ..

# - name: Decode google-service
# id: decode_google-service
# uses: timheuer/[email protected]
# with:
# fileName: 'google-services.json'
# fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/'
# encodedString: ${{ secrets.GOOGLE_SERVICE_CONTENT }}

# - name: Decode env file
# id: decode_env
# uses: timheuer/[email protected]
# with:
# fileName: 'configuration.prod.ts'
# fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/'
# encodedString: ${{ secrets.ENV }}

# - name: Build Ionic assets
# run: ionic build --prod && npx cap sync

# - name: Execute test cases using JEST
# working-directory: src/app
# run: npm run test:ci

# - name: Decode Keystore
# id: decode_keystore
# uses: timheuer/[email protected]
# with:
# fileName: 'android_keystore.jks'
# fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/android/app/keystore/'
# encodedString: ${{ secrets.KEYSTORE }}

# - name: Decode signing properties
# id: decode_properties
# uses: timheuer/[email protected]
# with:
# fileName: 'signing.properties'
# fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/android/'
# encodedString: ${{ secrets.PROPERTIES }}

# - name: Build bundle
# run: cd android && ./gradlew app:bundleRelease
# env:
# SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
# SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
# SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}

# - name: Build APK
# run: cd android && ./gradlew assembleDebug

# - name: Upload APK
# uses: actions/[email protected]
# with:
# name: app-release
# path: ${{ github.workspace }}/android/app/build/outputs/
42 changes: 42 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Sonar

on:
workflow_run:
workflows: [Android] # Trigger when the Build-Test workflow completes
branches:
- 'release-**'
- 'master'
types:
- completed # Trigger on completion of the Build-Test workflow

jobs:
SonarScanner:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' # Run job only if Build-Test workflow succeeded

steps:
# Checkout repository to ensure we have the latest code
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Sonar Scanner
run: sudo npm install -g [email protected]

- name: Debug Event Payload
run: echo "${{ github.event.workflow_run.head_branch }}"

- name: Extract Branch Name
run: echo "${{ github.head_ref }}"

- name: Print SONAR_TOKEN
run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}PWR****123-${{ github.event.pull_request.number }}-${{ github.head_ref }}"

- name: Run SonarQube Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
run: |
sonar-scanner \
-Dsonar.login=$SONAR_TOKEN
-Dsonar.pullrequest.key=${{ github.event.pull_requests.number }} \
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.head_branch }}
13 changes: 9 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
ext.buildNumber = System.getenv("TRAVIS_BUILD_NUMBER") ?: "local"
versionName "8.0.local"
versionName "6.0.local"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand All @@ -25,11 +25,16 @@ android {
}
}
signingConfigs {
sign
release {
storeFile = file("keystore/android_keystore.jks")
storePassword System.getenv("SIGNING_STORE_PASSWORD")
keyAlias System.getenv("SIGNING_KEY_ALIAS")
keyPassword System.getenv("SIGNING_KEY_PASSWORD")
}
}
buildTypes {
release {
signingConfig signingConfigs.sign
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Expand Down Expand Up @@ -68,7 +73,7 @@ dependencies {
}

apply from: 'capacitor.build.gradle'
apply from: rootProject.file('signing.gradle')

try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
Expand Down
3 changes: 1 addition & 2 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ android {
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-apple-sign-in')
implementation project(':capacitor-community-barcode-scanner')
implementation project(':capacitor-community-file-opener')
implementation project(':capacitor-app')
implementation project(':capacitor-browser')
Expand All @@ -32,6 +31,7 @@ dependencies {
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
implementation "com.google.android.play:core:1.9.1"
implementation "com.android.support:support-v4:28.+"
implementation "com.android.support:appcompat-v7:27.+"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.browser:browser:1.0.0"
Expand All @@ -43,7 +43,6 @@ dependencies {
apply from: "../../node_modules/cordova-plugin-qr-scanner/build-extras.gradle"
apply from: "../../node_modules/com-sarriaroman-photoviewer/src/android/photoviewer.gradle"
apply from: "../../node_modules/cordova-plugin-fcm-with-dependecy-updated/src/android/FCMPlugin.gradle"
apply from: "../../node_modules/cordova-plugin-code-push/src/android/build-extras.gradle"
apply from: "../../node_modules/cordova-plugin-telerik-imagepicker/src/android/ignorelinterrors.gradle"
apply from: "../../node_modules/cordova-plugin-telerik-imagepicker/src/android/androidtarget.gradle"

Expand Down
4 changes: 3 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@
-keep class com.google.android.gms.** { *; }
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
-keep class io.liteglue.SQLiteNativeResponse { *; }
-keep class io.liteglue.SQLiteNativeResponse { *; }
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }
3 changes: 0 additions & 3 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
include ':capacitor-community-apple-sign-in'
project(':capacitor-community-apple-sign-in').projectDir = new File('../node_modules/@capacitor-community/apple-sign-in/android')

include ':capacitor-community-barcode-scanner'
project(':capacitor-community-barcode-scanner').projectDir = new File('../node_modules/@capacitor-community/barcode-scanner/android')

include ':capacitor-community-file-opener'
project(':capacitor-community-file-opener').projectDir = new File('../node_modules/@capacitor-community/file-opener/android')

Expand Down
7 changes: 4 additions & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
# App.properties
app_name=Sunbird
app_id=org.sunbird.app.staging
flavor=staging
app_name=Sunbird
app_id=org.sunbird.app.staging
flavor=staging
custom_scheme_url=staging.diksha.app
15 changes: 15 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@
"replace": "configurations/configuration.ts",
"with": "configurations/configuration.stag.ts"
}
],
"optimization": false,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "16mb",
"maximumError": "40mb"
}
]
},
"hmr": {
Expand Down
Loading

0 comments on commit a4a0197

Please sign in to comment.