diff --git a/.github/workflows/newBuild.yml b/.github/workflows/newBuild.yml index a8c6a098..ddc37bbe 100644 --- a/.github/workflows/newBuild.yml +++ b/.github/workflows/newBuild.yml @@ -1,4 +1,4 @@ -name: Create-Apk-QA +name: generate-apk on: workflow_dispatch: @@ -8,23 +8,31 @@ on: required: true type: choice options: - - qa - - dev + - QA + - Prod + flavor: + description: Choose build flavour + required: true + type: choice + options: + - fieldAgents + - callingAgents type: description: Choose build type required: true type: choice options: - - debug - release version_code: description: Enter app version code (example, 292) - required: false + required: true type: string + default: "292" version_name: description: Enter app version name (example, 3.2.1) - required: false + required: true type: string + default: "3.2.1" jobs: generate: runs-on: [ default ] @@ -69,21 +77,21 @@ jobs: run: chmod +x android/gradlew - name: Create local.properties run: cd android && touch local.properties && echo "sdk.dir = /home/USERNAME/Android/Sdk" > local.properties - - name: Assemble with Stacktrace - QA debug - if: ((github.event.inputs.environment == 'qa' || inputs.environment == 'qa') && (github.event.inputs.type == 'debug' || inputs.type == 'debug')) - run: yarn move:qa && yarn debug && cd android && ./gradlew assembleDebug - - name: Assemble with Stacktrace - Dev debug - if: ((github.event.inputs.environment == 'dev' || inputs.environment == 'dev') && (github.event.inputs.type == 'debug' || inputs.type == 'debug')) - run: yarn move:dev && yarn debug && cd android && ./gradlew assembleDebug - - name: Assemble with Stacktrace - QA release - if: ((github.event.inputs.environment == 'qa' || inputs.environment == 'qa') && (github.event.inputs.type == 'release' || inputs.type == 'release')) - run: yarn move:qa && cd android && ./gradlew assembleRelease - - name: Assemble with Stacktrace - Dev release - if: ((github.event.inputs.environment == 'dev' || inputs.environment == 'dev') && (github.event.inputs.type == 'debug' || inputs.type == 'release')) - run: yarn move:dev && cd android && ./gradlew assembleRelease + - name: Assemble with Stacktrace - Field QA release + if: ((github.event.inputs.environment == 'QA' || inputs.environment == 'QA') && (github.event.flavor.type == 'fieldAgents' || inputs.flavor == 'fieldAgents')) + run: yarn move:qa && cd android && ./gradlew assemblefieldAgentsQARelease + - name: Assemble with Stacktrace - Field PROD release + if: ((github.event.inputs.environment == 'Prod' || inputs.environment == 'Prod') && (github.event.flavor.type == 'fieldAgents' || inputs.flavor == 'fieldAgents')) + run: yarn move:prod && cd android && ./gradlew assemblefieldAgentsProdRelease + - name: Assemble with Stacktrace - Calling QA release + if: ((github.event.inputs.environment == 'QA' || inputs.environment == 'QA') && (github.event.flavor.type == 'callingAgents' || inputs.flavor == 'callingAgents')) + run: yarn move:qa && cd android && ./gradlew assemblefieldAgentsQARelease + - name: Assemble with Stacktrace - Calling PROD release + if: ((github.event.inputs.environment == 'Prod' || inputs.environment == 'Prod') && (github.event.flavor.type == 'callingAgents' || inputs.flavor == 'callingAgents')) + run: yarn move:prod && cd android && ./gradlew assemblefieldAgentsProdRelease - name: Upload APK as Artifact uses: actions/upload-artifact@v3 with: - name: app-${{ github.event.inputs.type || inputs.type }} - path: android/app/build/outputs/apk/${{ github.event.inputs.type || inputs.type }}/ + name: app-${{ github.event.inputs.type || inputs.type }}-v${{ github.event.inputs.version_code || inputs.version_code }}-name-${{github.event.inputs.version_name || inputs.version_name}} + path: android/app/build/outputs/apk/${{ github.event.inputs.flavor || inputs.flavor }}${{github.event.inputs.environment || inputs.environment}}/${{github.event.inputs.type || inputs.type}} retention-days: 30