mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -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:
|
env:
|
||||||
backendServiceDefaultUrl: https://api.sandbox.mosip.net
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -13,12 +53,12 @@ on:
|
|||||||
- 0.9
|
- 0.9
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize ]
|
types: [ opened, synchronize ]
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- 'release-**'
|
- 'release-**'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -29,7 +69,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
|
|
||||||
- name: Cache local npm repository
|
- name: Cache local npm repository
|
||||||
uses: actions/cache@v3.0.11
|
uses: actions/cache@v3.0.11
|
||||||
with:
|
with:
|
||||||
@@ -43,7 +83,14 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
~/.gradle/caches
|
||||||
~/.gradle/wrapper
|
~/.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
|
- name: Install npm dependencies
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
@@ -52,12 +99,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties
|
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
|
- name: Setup branch and GPG public key
|
||||||
run: |
|
run: |
|
||||||
# Strip git ref prefix from version
|
# Strip git ref prefix from version
|
||||||
@@ -71,10 +112,17 @@ jobs:
|
|||||||
- name: Setup Firebase
|
- name: Setup Firebase
|
||||||
run: |
|
run: |
|
||||||
cd android
|
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:
|
env:
|
||||||
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}
|
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}
|
||||||
|
|
||||||
- name: Generate keystore
|
- name: Generate keystore
|
||||||
run: |
|
run: |
|
||||||
keytool \
|
keytool \
|
||||||
@@ -88,16 +136,16 @@ jobs:
|
|||||||
-alias androiddebugkey \
|
-alias androiddebugkey \
|
||||||
-keystore android/app/debug.keystore \
|
-keystore android/app/debug.keystore \
|
||||||
-dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US"
|
-dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US"
|
||||||
env:
|
env:
|
||||||
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'
|
DEBUG_KEYSTORE_PASSWORD: ${{secrets.INJI_ANDROID_DEBUG_STOREPASS || env.DUMMY_INJI_ANDROID_DEBUG_STOREPASS }}
|
||||||
|
|
||||||
- name: Export variables for keystore
|
- name: Export variables for keystore
|
||||||
run: |
|
run: |
|
||||||
cd android/app
|
cd android/app
|
||||||
export DEBUG_KEYSTORE_ALIAS=androiddebugkey
|
export DEBUG_KEYSTORE_ALIAS=androiddebugkey
|
||||||
export DEBUG_KEYSTORE_PASSWORD=$DEBUG_KEYSTORE_PASSWORD
|
export DEBUG_KEYSTORE_PASSWORD=$DEBUG_KEYSTORE_PASSWORD
|
||||||
env:
|
env:
|
||||||
DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}'
|
DEBUG_KEYSTORE_PASSWORD: ${{secrets.INJI_ANDROID_DEBUG_STOREPASS || env.DUMMY_INJI_ANDROID_DEBUG_STOREPASS }}
|
||||||
|
|
||||||
- name: Bump version code
|
- name: Bump version code
|
||||||
uses: chkfung/android-version-actions@v1.2.1
|
uses: chkfung/android-version-actions@v1.2.1
|
||||||
@@ -106,9 +154,9 @@ jobs:
|
|||||||
versionCode: ${{github.run_number}}
|
versionCode: ${{github.run_number}}
|
||||||
|
|
||||||
- name: Run Build using Fastlane
|
- name: Run Build using Fastlane
|
||||||
run: |
|
run: |
|
||||||
cd android/scripts
|
cd android/scripts
|
||||||
./verify-build.sh
|
./verify-build.sh
|
||||||
env:
|
env:
|
||||||
DEBUG_KEYSTORE_ALIAS: androiddebugkey
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,38 +10,38 @@ on:
|
|||||||
- 0.9
|
- 0.9
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize ]
|
types: [ opened, synchronize ]
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- 'release-**'
|
- 'release-**'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_ios:
|
build_ios:
|
||||||
name: Building the IPA
|
name: Building the IPA
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v3.1.0
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
- name: Install Pod
|
- name: Install Pod
|
||||||
run: |
|
run: |
|
||||||
cd ios
|
cd ios
|
||||||
pod install
|
pod install
|
||||||
|
|
||||||
- name: Building the IPA
|
- name: Building the IPA
|
||||||
run: |
|
run: |
|
||||||
cd ios
|
cd ios
|
||||||
fastlane build_verify
|
fastlane build_app_for_automation_on_simulator
|
||||||
env:
|
env:
|
||||||
APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
|
APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
|
||||||
DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}'
|
DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}'
|
||||||
@@ -56,4 +56,4 @@ jobs:
|
|||||||
APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}'
|
APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}'
|
||||||
APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}'
|
APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}'
|
||||||
APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}'
|
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,
|
ios: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'react-native-flipper': {
|
||||||
|
platforms: {
|
||||||
|
ios: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user