diff --git a/.github/workflows/build_apk.yml b/.github/workflows/build_apk.yml index fee49ab..599111a 100644 --- a/.github/workflows/build_apk.yml +++ b/.github/workflows/build_apk.yml @@ -26,6 +26,10 @@ on: type: boolean description: Include IAP package default: true + stage-backend: + type: boolean + description: Use stage backend + default: true workflow_dispatch: inputs: version: @@ -51,6 +55,10 @@ on: type: boolean description: Include IAP package default: true + stage-backend: + type: boolean + description: Use stage backend + default: true env: BUILD_ARGS: --release --flavor ${{ inputs.flavor }} -t lib/main_${{ inputs.flavor }}.dart @@ -93,11 +101,16 @@ jobs: bash .github/scripts/restore_from_base64.sh "${{ secrets.KEYSTORE_PROPERTIES }}" "$RUNNER_TEMP/android/app/key.properties" bash .github/scripts/restore_from_base64.sh "${{ secrets.KEYSTORE }}" "$RUNNER_TEMP/android/keystore.jks" - - name: Restore secrets - run: | - bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" - bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart" - bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}" "android/app/google-services.json" + - name: Restore google-services.json + run: bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}" "android/app/google-services.json" + + - name: Restore firebase_options.dart + run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" + + - name: Restore constants.dart + env: + CONSTANTS: ${{inputs.stage-backend && secrets.CONSTANTS_STAGE || secrets.CONSTANTS }} + run: bash .github/scripts/restore_from_base64.sh "${{ env.CONSTANTS }}" "lib/constants.dart" - name: Increment build number & replace version number run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} diff --git a/.github/workflows/build_ipa.yml b/.github/workflows/build_ipa.yml index 91c4247..1eef9b3 100644 --- a/.github/workflows/build_ipa.yml +++ b/.github/workflows/build_ipa.yml @@ -7,6 +7,11 @@ name: Build Prod .ipa on: workflow_dispatch: + inputs: + stage-backend: + type: boolean + description: Use stage backend + default: true env: FLAVOR: "prod" @@ -62,7 +67,9 @@ jobs: run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" - name: Restore constants.dart - run: bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart" + env: + CONSTANTS: ${{inputs.stage-backend && secrets.CONSTANTS_STAGE || secrets.CONSTANTS }} + run: bash .github/scripts/restore_from_base64.sh "${{ env.CONSTANTS }}" "lib/constants.dart" - name: Install Flutter uses: subosito/flutter-action@v2 @@ -89,7 +96,7 @@ jobs: with: name: m3_lightmeter_$FLAVOR_ipa path: build/ios/ipa/lightmeter.ipa - + - name: Clean up keychain and provisioning profile if: ${{ always() }} run: | diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2419710..2870132 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -22,10 +22,6 @@ on: description: "Release notes" required: true type: string - include-iap: - type: boolean - description: Include IAP package - default: true jobs: run-integration-tests: @@ -45,7 +41,7 @@ jobs: with: binary-type: ${{ matrix.binary-type }} flavor: prod - include-iap: ${{ inputs.include-iap }} + stage-backend: false version: ${{ inputs.version }} generate-release-notes: