TP-71465 | Error handling in generate apk action

This commit is contained in:
yashmantri
2024-09-09 20:41:40 +05:30
parent 82f59eedb7
commit 9d013b6a62

View File

@@ -130,10 +130,18 @@ jobs:
ls
chmod +r ./android/app/build/outputs/apk/${{ github.event.inputs.flavor || inputs.flavor }}${{github.event.inputs.environment || inputs.environment}}/${{github.event.inputs.type || inputs.type}}/app-${{github.event.inputs.flavor}}${{github.event.inputs.environment}}-release.apk
apk_path="./android/app/build/outputs/apk/${{ github.event.inputs.flavor || inputs.flavor }}${{github.event.inputs.environment || inputs.environment}}/${{github.event.inputs.type || inputs.type}}/app-${{ github.event.inputs.flavor || inputs.flavor }}${{github.event.inputs.environment || inputs.environment}}-release.apk"
# Check if APK exists, exit if not
if [ ! -f "$apk_path" ]; then
echo "Error: APK file not found at $apk_path"
exit 1
fi
chmod +r "$apk_path"
curl --location --request PUT "$upload_url" \
--data-binary "@./android/app/build/outputs/apk/${{ github.event.inputs.flavor || inputs.flavor }}${{github.event.inputs.environment || inputs.environment}}/${{github.event.inputs.type || inputs.type}}/app-fieldAgentsQA-release.apk"
--data-binary "@$apk_path"
echo "upload compleate"