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

feat(Inji-293) Update GitHub actions to test build on PR #902

Merged
merged 27 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ccffd3c
feat(inji-293): Update Expo to 44.0.6 to fix ios build issues
tilak-puli Aug 28, 2023
9d3f86a
feat(inji-293): Run ios verify build on pull requests from feature a…
tilak-puli Aug 28, 2023
ce534c4
feat(inji-293): revert ios build running on pull request to feature
tilak-puli Aug 28, 2023
1e12bf9
feat(inji-293): Use dummy values for google services json and password
tilak-puli Sep 1, 2023
2a245ec
feat(inji-293): use dummy google services json variable directly ins…
tilak-puli Sep 1, 2023
c90e524
feat(inji-293): Fix syntax error for using dummy google services jso…
tilak-puli Sep 1, 2023
3a16826
feat(inji-293): remove unnecessary play file setup and update fireba…
tilak-puli Sep 1, 2023
134ddca
feat(inji-293): update dummy google services json with dummy values
tilak-puli Sep 1, 2023
f1b0533
feat(inji-293): use DUMMY_INJI_ANDROID_DEBUG_STOREPASS env for dummy…
tilak-puli Sep 1, 2023
5733d61
feat(inji-293): refactor using dummy google service json in firebase
tilak-puli Sep 1, 2023
57b123a
feat(inji-293): Use GITHUB_ENV to access file level env variables
tilak-puli Sep 1, 2023
501a740
feat(inji-293): read dummy google services json from a file
tilak-puli Sep 1, 2023
2798947
feat(inji-293): fix bash syntax of accessing env variable
tilak-puli Sep 1, 2023
764bc24
feat(inji-293): fix bash syntax accessing dummy services json file
tilak-puli Sep 1, 2023
df879d5
feat(inji-293): fix path to dummy google services json
tilak-puli Sep 1, 2023
3cb06de
feat(inji-293): fix bash syntax of reading dummy json
tilak-puli Sep 1, 2023
d40b87a
feat(inji-293): fix bash syntax of reading dummy json
tilak-puli Sep 1, 2023
0baf48b
feat(inji-293): fix bash syntax of reading dummy json
tilak-puli Sep 1, 2023
8b9301b
feat(inji-293): use python script to load dummy values from a env file
tilak-puli Sep 1, 2023
3c0c4f6
feat(inji-293): fix variable names in dummy env
tilak-puli Sep 1, 2023
6eb64cf
feat(inji-293): Revert dot env usage to get dummy env values
tilak-puli Sep 1, 2023
7f36720
Merge remote-tracking branch 'upstream/develop' into feature-293-git-…
tilak-puli Oct 10, 2023
5654d9b
feat(inji-293): update node version 18 for ios build verify
tilak-puli Oct 10, 2023
b10e9a2
feat(inji-293): try using build_app_for_automation_on_simulator for …
tilak-puli Oct 10, 2023
05d7e51
feat(inji-293): try using build_app_for_automation_on_simulator for …
tilak-puli Oct 10, 2023
d5ae225
feat(inji-293): fix react native flipper failing in build
tilak-puli Oct 10, 2023
e18a841
feat(inji-293): remove formatting changes in unchanged files
tilak-puli Oct 11, 2023
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
86 changes: 67 additions & 19 deletions .github/workflows/android-build-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,12 +53,12 @@ on:
- 0.9
tags:
- '*'
pull_request:
pull_request:
types: [ opened, synchronize ]
branches:
- develop
- 'release-**'
tags:
tags:
- '*'

jobs:
Expand All @@ -29,7 +69,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Cache local npm repository
uses: actions/[email protected]
with:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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/[email protected]
Expand All @@ -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 changes: 10 additions & 10 deletions .github/workflows/ios-build-verify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR - IOS build verification
name: PR - IOS build verification

on:
push:
Expand All @@ -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/[email protected]
- 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 }}'
Expand All @@ -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 changes: 5 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ module.exports = {
ios: null,
},
},
'react-native-flipper': {
platforms: {
ios: null,
},
},
},
};