Skip to content

Commit

Permalink
Merge pull request #765 from tw-mosip/release-0.9.x
Browse files Browse the repository at this point in the history
[Release 01-08-2023] : New UI Revamp, Max Storage Limit Handling, Bluetooth permission handling and Other Refactoring
  • Loading branch information
dhivya0413 authored Aug 2, 2023
2 parents bd8517b + c47ecf9 commit e7bec4a
Show file tree
Hide file tree
Showing 270 changed files with 11,276 additions and 7,394 deletions.
8 changes: 6 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# after making changes to the env file, ensure to start the bundler (or the project) with a --reset-cache
# eg . npm build android:newlogic --reset-cache

MIMOTO_HOST=https://api.qa-1201-b2.mosip.net
MIMOTO_HOST=https://api.qatriple.mosip.net
#MIMOTO_HOST=http://mock.mimoto.newlogic.dev
GOOGLE_NEARBY_MESSAGES_API_KEY=
#Application Theme can be ( orange | purple )
APPLICATION_THEME=orange

USE_BLE_SHARE=true
#environment can be changed if it is toggled
CREDENTIAL_REGISTRY_EDIT=true

#supported languages( en, fil, ar, hi, kn, ta)
APPLICATION_LANGUAGE=en
142 changes: 142 additions & 0 deletions .github/workflows/android-beta-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Android Beta Build

env:
backendServiceDefaultUrl: https://api.sandbox.mosip.net

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to be published'
required: true
default: 'v1.2.3'
type: string
body:
description: 'Release body message'
required: true
default: 'Changes in this Release'
type: string
pre-release:
description: 'Pre-release? True/False'
required: true
default: False
type: string
backendServiceUrl:
description: 'Backend service URL'
required: true
default: 'https://api.sandbox.mosip.net'
type: string
theme:
description: 'Application Theme'
required: true
default: 'orange'
type: choice
options:
- orange
- purple
buildDescription:
description: 'What to test'
required: true
default: 'QA-Triple environment'
type: string
registry_edit:
description: 'Edit Registry'
required: true
default: 'true'
type: choice
options:
- false
- true

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }}
body: ${{ github.event.inputs.body }}
draft: false
prerelease: ${{fromJSON(github.event.inputs.pre-release)}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for git tag
run: |
cd android/scripts
./git-tag.sh
- name: Install npm dependencies
run: |
npm ci
- name: Create .env.local file
run: |
echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Setup branch and GPG public key
run: |
# Strip git ref prefix from version
echo ${{ env.BRANCH_NAME }}
echo ${{ env.GPG_TTY }}
sudo apt-get --yes install gnupg2
gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
- name: Setup Firebase
run: |
cd android
if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi
env:
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}

- name: Generate keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64
base64 -d -i release.keystore.b64 > android/app/release.keystore
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }}

- name: Export variables for keystore
run: |
cd android/app
export RELEASE_KEYSTORE_ALIAS=androidreleasekey
export RELEASE_KEYSTORE_PASSWORD=$RELEASE_KEYSTORE_PASSWORD
env:
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}'

- name: Create Google Play Config file
run : |
cd android
echo "$INJI_ANDROID_PLAY_STORE_CONFIG_JSON" > play_config.json.b64
base64 -d -i play_config.json.b64 > play_config.json
env:
INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }}

- name: Run Build
run: |
cd android/scripts
./beta-build.sh
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
APPLICATION_THEME: ${{ github.event.inputs.theme }}
RELEASE_KEYSTORE_ALIAS: androidreleasekey
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}'
SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}'
PLAY_CONSOLE_RELEASE_DESCRIPTION: ${{ github.event.inputs.buildDescription }}
CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }}
114 changes: 114 additions & 0 deletions .github/workflows/android-build-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: PR - Android build verification

env:
backendServiceDefaultUrl: https://api.sandbox.mosip.net

on:
push:
branches:
- main
- develop
- demobranch
- qa-develop
- 0.9
tags:
- '*'
pull_request:
types: [ opened, synchronize ]
branches:
- develop
- 'release-**'
tags:
- '*'

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Cache local npm repository
uses: actions/[email protected]
with:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.npm

- name: Cache local gradle repository
uses: actions/[email protected]
with:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Install npm dependencies
run: |
npm ci
- name: Create .env.local file
run: |
echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Setup branch and GPG public key
run: |
# Strip git ref prefix from version
echo ${{ env.BRANCH_NAME }}
echo ${{ env.GPG_TTY }}
sudo apt-get --yes install gnupg2
gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
- name: Setup Firebase
run: |
cd android
if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi
env:
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}

- name: Generate keystore
run: |
keytool \
-genkey -v \
-storetype PKCS12 \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-storepass $DEBUG_KEYSTORE_PASSWORD \
-keypass $DEBUG_KEYSTORE_PASSWORD \
-alias androiddebugkey \
-keystore android/app/debug.keystore \
-dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US"
env:
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'

- name: Export variables for keystore
run: |
cd android/app
export DEBUG_KEYSTORE_ALIAS=androiddebugkey
export DEBUG_KEYSTORE_PASSWORD=$DEBUG_KEYSTORE_PASSWORD
env:
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'

- name: Bump version code
uses: chkfung/[email protected]
with:
gradlePath: android/app/build.gradle
versionCode: ${{github.run_number}}

- name: Run Build using Fastlane
run: |
cd android/scripts
./verify-build.sh
env:
DEBUG_KEYSTORE_ALIAS: androiddebugkey
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android Custom Build
name: Android Internal Build

env:
backendServiceDefaultUrl: https://api.sandbox.mosip.net
Expand All @@ -19,6 +19,19 @@ on:
options:
- orange
- purple
buildDescription:
description: 'What to test'
required: true
default: 'QA-Triple environment'
type: string
registry_edit:
description: 'Edit Registry'
required: true
default: 'true'
type: choice
options:
- false
- true

jobs:
build-android:
Expand All @@ -28,8 +41,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16.x'

# Cache stuff for faster build

- name: Cache local npm repository
uses: actions/[email protected]
with:
Expand All @@ -46,7 +58,7 @@ jobs:
- name: Install npm dependencies
run: |
npm install
npm ci
- name: Create .env.local file
run: |
Expand All @@ -61,26 +73,52 @@ jobs:
- name: Setup branch and GPG public key
run: |
# Strip git ref prefix from version
echo ${{ env.BRANCH_NAME }}
echo ${{ env.GPG_TTY }}
sudo apt-get --yes install gnupg2
gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
- name: Build App Newlogic Release
- name: Setup Firebase
run: |
cd android
if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi
./gradlew :app:assembleNewlogicRelease
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}
APPLICATION_THEME: ${{ github.event.inputs.theme }}
- name: Upload Artifact
uses: actions/[email protected]
with:
name: apk-output
path: android/app/build/outputs/apk/newlogic/release/
retention-days: 10

- name: Generate keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64
base64 -d -i release.keystore.b64 > android/app/release.keystore
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }}

- name: Export variables for keystore
run: |
cd android/app
export RELEASE_KEYSTORE_ALIAS=androidreleasekey
export RELEASE_KEYSTORE_PASSWORD=$RELEASE_KEYSTORE_PASSWORD
env:
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}'

- name: Create Google Play Config file
run : |
cd android
echo "$INJI_ANDROID_PLAY_STORE_CONFIG_JSON" > play_config.json.b64
base64 -d -i play_config.json.b64 > play_config.json
env:
INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }}

- name: Run Build
run: |
cd android/scripts
./internal-build.sh
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
APPLICATION_THEME: ${{ github.event.inputs.theme }}
RELEASE_KEYSTORE_ALIAS: androidreleasekey
RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}'
SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}'
PLAY_CONSOLE_RELEASE_DESCRIPTION: ${{ github.event.inputs.buildDescription }}
CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }}
Loading

0 comments on commit e7bec4a

Please sign in to comment.