mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-08 21:18:14 -05:00
feat(Inji-293) Update GitHub actions to test build on PR (#902)
* feat(inji-293): Update Expo to 44.0.6 to fix ios build issues * feat(inji-293): Run ios verify build on pull requests from feature as well * feat(inji-293): revert ios build running on pull request to feature * feat(inji-293): Use dummy values for google services json and password * feat(inji-293): use dummy google services json variable directly instead of secret in verify workflow * feat(inji-293): Fix syntax error for using dummy google services json variable directly * feat(inji-293): remove unnecessary play file setup and update firebase setup to use dummy google service json * feat(inji-293): update dummy google services json with dummy values * feat(inji-293): use DUMMY_INJI_ANDROID_DEBUG_STOREPASS env for dummy password * feat(inji-293): refactor using dummy google service json in firebase * feat(inji-293): Use GITHUB_ENV to access file level env variables * feat(inji-293): read dummy google services json from a file * feat(inji-293): fix bash syntax of accessing env variable * feat(inji-293): fix bash syntax accessing dummy services json file * feat(inji-293): fix path to dummy google services json * feat(inji-293): fix bash syntax of reading dummy json * feat(inji-293): fix bash syntax of reading dummy json * feat(inji-293): fix bash syntax of reading dummy json * feat(inji-293): use python script to load dummy values from a env file * feat(inji-293): fix variable names in dummy env * feat(inji-293): Revert dot env usage to get dummy env values * feat(inji-293): update node version 18 for ios build verify Signed-off-by: Tilak Puli <tilakpuli15@gmail.com> * feat(inji-293): try using build_app_for_automation_on_simulator for ios build verify Signed-off-by: Tilak Puli <tilakpuli15@gmail.com> * feat(inji-293): try using build_app_for_automation_on_simulator for ios build verify Signed-off-by: Tilak Puli <tilakpuli15@gmail.com> * feat(inji-293): fix react native flipper failing in build Signed-off-by: Tilak Puli <tilakpuli15@gmail.com> * feat(inji-293): remove formatting changes in unchanged files Signed-off-by: Tilak Puli <tilakpuli15@gmail.com> --------- Signed-off-by: Tilak Puli <tilakpuli15@gmail.com>
This commit is contained in:
86
.github/workflows/android-build-verify.yml
vendored
86
.github/workflows/android-build-verify.yml
vendored
@@ -2,6 +2,46 @@ name: PR - Android build verification
|
||||
|
||||
env:
|
||||
backendServiceDefaultUrl: https://api.sandbox.mosip.net
|
||||
DUMMY_INJI_ANDROID_DEBUG_STOREPASS: 'password'
|
||||
DUMMY_GOOGLE_SERVICE_JSON: '{
|
||||
"project_info": {
|
||||
"project_number": "mockproject-1234",
|
||||
"project_id": "123456789000",
|
||||
"storage_bucket": "mock-project.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
|
||||
"android_client_info": {
|
||||
"package_name": "io.mosip.residentapp"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzbSzCn1N6LWIe6wthYyrgUUSAlUsdqMb-wvTo"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}'
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -13,12 +53,12 @@ on:
|
||||
- 0.9
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
pull_request:
|
||||
types: [ opened, synchronize ]
|
||||
branches:
|
||||
- develop
|
||||
- 'release-**'
|
||||
tags:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
@@ -29,7 +69,7 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.x'
|
||||
|
||||
|
||||
- name: Cache local npm repository
|
||||
uses: actions/cache@v3.0.11
|
||||
with:
|
||||
@@ -43,7 +83,14 @@ jobs:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
|
||||
|
||||
- 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
|
||||
echo "DUMMY_INJI_ANDROID_DEBUG_STOREPASS=$DUMMY_INJI_ANDROID_DEBUG_STOREPASS" >> $GITHUB_ENV
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm ci
|
||||
@@ -52,12 +99,6 @@ jobs:
|
||||
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
|
||||
@@ -71,10 +112,17 @@ jobs:
|
||||
- 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
|
||||
|
||||
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;
|
||||
else
|
||||
echo "Using Dummy Google Service JSON for firebase"
|
||||
echo "$DUMMY_GOOGLE_SERVICE_JSON" > app/google-services.json
|
||||
fi
|
||||
env:
|
||||
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}
|
||||
|
||||
|
||||
- name: Generate keystore
|
||||
run: |
|
||||
keytool \
|
||||
@@ -88,16 +136,16 @@ jobs:
|
||||
-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}}'
|
||||
env:
|
||||
DEBUG_KEYSTORE_PASSWORD: ${{secrets.INJI_ANDROID_DEBUG_STOREPASS || env.DUMMY_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}}'
|
||||
env:
|
||||
DEBUG_KEYSTORE_PASSWORD: ${{secrets.INJI_ANDROID_DEBUG_STOREPASS || env.DUMMY_INJI_ANDROID_DEBUG_STOREPASS }}
|
||||
|
||||
- name: Bump version code
|
||||
uses: chkfung/android-version-actions@v1.2.1
|
||||
@@ -106,9 +154,9 @@ jobs:
|
||||
versionCode: ${{github.run_number}}
|
||||
|
||||
- name: Run Build using Fastlane
|
||||
run: |
|
||||
run: |
|
||||
cd android/scripts
|
||||
./verify-build.sh
|
||||
env:
|
||||
env:
|
||||
DEBUG_KEYSTORE_ALIAS: androiddebugkey
|
||||
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'
|
||||
DEBUG_KEYSTORE_PASSWORD: ${{secrets.INJI_ANDROID_DEBUG_STOREPASS || env.DUMMY_INJI_ANDROID_DEBUG_STOREPASS }}
|
||||
|
||||
20
.github/workflows/ios-build-verify.yml
vendored
20
.github/workflows/ios-build-verify.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: PR - IOS build verification
|
||||
name: PR - IOS build verification
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -10,38 +10,38 @@ on:
|
||||
- 0.9
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
pull_request:
|
||||
types: [ opened, synchronize ]
|
||||
branches:
|
||||
- develop
|
||||
- 'release-**'
|
||||
tags:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build_ios:
|
||||
name: Building the IPA
|
||||
runs-on: macos-13
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3.1.0
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.x'
|
||||
|
||||
node-version: '18.x'
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm install
|
||||
|
||||
|
||||
- name: Install Pod
|
||||
run: |
|
||||
cd ios
|
||||
pod install
|
||||
|
||||
|
||||
- name: Building the IPA
|
||||
run: |
|
||||
cd ios
|
||||
fastlane build_verify
|
||||
fastlane build_app_for_automation_on_simulator
|
||||
env:
|
||||
APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
|
||||
DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}'
|
||||
@@ -56,4 +56,4 @@ jobs:
|
||||
APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}'
|
||||
APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}'
|
||||
APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}'
|
||||
MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}'
|
||||
MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}'
|
||||
|
||||
@@ -5,5 +5,10 @@ module.exports = {
|
||||
ios: null,
|
||||
},
|
||||
},
|
||||
'react-native-flipper': {
|
||||
platforms: {
|
||||
ios: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user