diff --git a/.github/workflows/newBuild.yml b/.github/workflows/newBuild.yml index 558b1cdf..019146ca 100644 --- a/.github/workflows/newBuild.yml +++ b/.github/workflows/newBuild.yml @@ -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"