NTP-28802 | merge tele field workflows

This commit is contained in:
Aman Chaturvedi
2025-01-21 19:30:34 +05:30
parent afbcaa720d
commit 9cf6bc9039
3 changed files with 361 additions and 336 deletions

View File

@@ -26,6 +26,9 @@ on:
releaseType:
required: true
type: string
runnerType:
required: true
type: string
flavor:
required: true
type: string
@@ -50,10 +53,22 @@ jobs:
submodules: recursive
- name: update codepush key QA
if: inputs.environment == 'QA'
run: sed -i "s/pastekeyhere/${{ secrets.CODEPUSH_QA_KEY }}/" android/app/src/main/res/values/strings.xml && cat android/app/src/main/res/values/strings.xml
run: |
if [[ "${{inputs.runnerType}}" == "macos" ]]; then
sed -i "" "s/pastekeyhere/${{ secrets.CODEPUSH_QA_KEY }}/" android/app/src/main/res/values/strings.xml
else
sed -i "s/pastekeyhere/${{ secrets.CODEPUSH_QA_KEY }}/" android/app/src/main/res/values/strings.xml
fi
cat android/app/src/main/res/values/strings.xml
- name: update codepush key PROD
if: inputs.environment == 'Prod'
run: sed -i "s/pastekeyhere/${{ secrets.TELE_CODE_PUSH_PROD_KEY }}/" android/app/src/main/res/values/strings.xml && cat android/app/src/main/res/values/strings.xml
run: |
if [[ "${{inputs.runnerType}}" == "macos" ]]; then
sed -i "" "s/pastekeyhere/${{ secrets.TELE_CODE_PUSH_PROD_KEY }}/" android/app/src/main/res/values/strings.xml
else
sed -i "s/pastekeyhere/${{ secrets.TELE_CODE_PUSH_PROD_KEY }}/" android/app/src/main/res/values/strings.xml
fi
cat android/app/src/main/res/values/strings.xml
- name: Generate keystore
if: inputs.type == 'release'
run: echo "${{ secrets.KEY_STORE }}" > keystore.asc && gpg -d --passphrase "${{ secrets.PASSPHARASE }}" --batch keystore.asc > android/app/my-upload-key.keystore
@@ -66,11 +81,21 @@ jobs:
- name: Install dependency
run: yarn
- name: Override App Version Code
if: github.event_name == 'workflow_call' && inputs.version_code != ''
run: sed -i 's/def VERSION_CODE = [0-9].*/def VERSION_CODE = ${{ inputs.version_code }}/g' android/app/build.gradle
if: github.event_name == 'workflow_dispatch' && inputs.version_code != ''
run: |
if [[ "${{inputs.runnerType}}" == "macos" ]]; then
sed -i "" 's/def VERSION_CODE = [0-9].*/def VERSION_CODE = '${{ inputs.version_code }}'/g' android/app/build.gradle
else
sed -i 's/def VERSION_CODE = [0-9].*/def VERSION_CODE = '${{ inputs.version_code }}'/g' android/app/build.gradle
fi
- name: Override App Version Name
if: github.event_name == 'workflow_call' && inputs.version_name != ''
run: sed -i 's/def VERSION_NAME = "[0-9].*"/def VERSION_NAME = "${{ inputs.version_name }}"/g' android/app/build.gradle
if: github.event_name == 'workflow_dispatch' && inputs.version_name != ''
run: |
if [[ "${{inputs.runnerType}}" == "macos" ]]; then
sed -i "" 's/def VERSION_NAME = "[0-9].*"/def VERSION_NAME = "'${{ inputs.version_name }}'"/g' android/app/build.gradle
else
sed -i 's/def VERSION_NAME = "[0-9].*"/def VERSION_NAME = "'${{ inputs.version_name }}'"/g' android/app/build.gradle
fi
- name: Log Build Metadata
run: |
echo "Commit SHA: ${{ github.sha }}"
@@ -188,33 +213,38 @@ jobs:
- name: Compile Hermes Bytecode and Generate Source Maps
run: |
node_modules/react-native/sdks/hermesc/linux64-bin/hermesc \
-O -emit-binary \
-output-source-map \
-out=index.android.bundle.hbc \
index.android.bundle
if [[ "${{inputs.runnerType}}" == "macos" ]]; then
HERMESC_PATH="node_modules/react-native/sdks/hermesc/osx-bin/hermesc"
else
HERMESC_PATH="node_modules/react-native/sdks/hermesc/linux64-bin/hermesc"
fi
$HERMESC_PATH \
-O -emit-binary \
-output-source-map \
-out=index.android.bundle.hbc \
index.android.bundle
# Remove the original bundle to prevent duplication
rm -f index.android.bundle
# Remove the original bundle to prevent duplication
rm -f index.android.bundle
# Rename the Hermes bundle and source map
mv index.android.bundle.hbc index.android.bundle
mv index.android.bundle.map index.android.bundle.packager.map
# Rename the Hermes bundle and source map
mv index.android.bundle.hbc index.android.bundle
mv index.android.bundle.map index.android.bundle.packager.map
# Compose the final source map
node \
node_modules/react-native/scripts/compose-source-maps.js \
index.android.bundle.packager.map \
index.android.bundle.hbc.map \
-o index.android.bundle.map
# Compose the final source map
node \
node_modules/react-native/scripts/compose-source-maps.js \
index.android.bundle.packager.map \
index.android.bundle.hbc.map \
-o index.android.bundle.map
# Clean up the temporary files
rm -f index.android.bundle.packager.map
# Clean up the temporary files
rm -f index.android.bundle.packager.map
- name: Upload Source Map
uses: actions/upload-artifact@v3
with:
name: source-map
name: source-map-${{inputs.version_name}}
path: index.android.bundle.map
create_release_tag: