diff --git a/.github/workflows/newBuild.yml b/.github/workflows/newBuild.yml index d569d0a5..1f6b5b2a 100644 --- a/.github/workflows/newBuild.yml +++ b/.github/workflows/newBuild.yml @@ -10,6 +10,14 @@ on: options: - qa - dev + version_code: + description: Enter app version code (example, 292) + required: false + type: string + version_name: + description: Enter app version name (example, 3.2.1) + required: false + type: string jobs: generate: runs-on: [ default ] @@ -27,6 +35,19 @@ jobs: run: npm install --global yarn - name: Install dependency run: yarn + - name: Override App Version Code + if: github.event_name == 'workflow_dispatch' && github.event.inputs.version_code != '' + run: sed -i 's/def VERSION_CODE = [0-9].*/def VERSION_CODE = ${{ github.event.inputs.version_code }}/g' android/app/build.gradle + - name: Override App Version Name + if: github.event_name == 'workflow_dispatch' && github.event.inputs.version_name != '' + run: sed -i 's/def VERSION_NAME = "[0-9].*"/def VERSION_NAME = "${{ github.event.inputs.version_name }}"/g' android/app/build.gradle + - name: Log Build Metadata + run: | + echo "Commit SHA: ${{ github.sha }}" + echo "Build Environment: ${{ github.event.inputs.environment || inputs.environment }}" + echo "Build Type: ${{ github.event.inputs.type || inputs.type }}" + echo "App Version Code: $(awk '/VERSION_CODE/ {print $4}' app/build.gradle)" + echo "App Version Name: $(awk '/VERSION_NAME/ {print $4}' app/build.gradle | tr -d '"')" - name: Set up JDK 11 uses: actions/setup-java@v3 with: