diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f2ebef..83e5479 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,11 @@ on: workflow_dispatch: inputs: build_type: - description: "Build type (release, nightly, or auto)" + description: "Build type (release, nightly)" required: false - default: "auto" + default: "nightly" type: choice options: - - auto - release - nightly @@ -53,7 +52,7 @@ jobs: id: check run: | # Determine build type based on trigger and input - if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.build_type }}" != "auto" ]]; then + if [[ "${{ github.event_name }}" == "workflow_dispatch"; then BUILD_TYPE="${{ github.event.inputs.build_type }}" elif [[ "${{ startsWith(github.ref, 'refs/tags/v') }}" == "true" ]]; then BUILD_TYPE="release" @@ -128,23 +127,10 @@ jobs: - name: Determine Build Type run: | - if [[ "${{ needs.fetch-info.outputs.build_type }}" == "release" ]]; then - echo "BUILD_MODE=release" >> $GITHUB_ENV - echo "ARTIFACT_SUFFIX=release-signed" >> $GITHUB_ENV - echo "AAB_PATH=productionRelease" >> $GITHUB_ENV - elif [[ "${{ needs.fetch-info.outputs.build_type }}" == "nightly" ]]; then - echo "BUILD_MODE=profile" >> $GITHUB_ENV - echo "ARTIFACT_SUFFIX=nightly" >> $GITHUB_ENV - echo "AAB_PATH=productionProfile" >> $GITHUB_ENV - else - echo "BUILD_MODE=profile" >> $GITHUB_ENV - echo "ARTIFACT_SUFFIX=production" >> $GITHUB_ENV - echo "AAB_PATH=productionProfile" >> $GITHUB_ENV - fi - echo "ARTIFACT_SUFFIX=${ARTIFACT_SUFFIX}" >> $GITHUB_OUTPUT + echo "ARTIFACT_SUFFIX=${{ needs.fetch-info.outputs.build_type }}" >> $GITHUB_ENV + echo "ARTIFACT_SUFFIX=${{ needs.fetch-info.outputs.build_type }}" >> $GITHUB_OUTPUT - name: Decode Keystore for release - if: needs.fetch-info.outputs.build_type == 'release' env: ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} @@ -183,14 +169,14 @@ jobs: - name: Build Android APK and AAB run: | - flutter build apk --${{ env.BUILD_MODE }} --build-number=${{github.run_number}} --flavor production - flutter build appbundle --${{ env.BUILD_MODE }} --build-number=${{github.run_number}} --flavor production + flutter build apk --release --build-number=${{github.run_number}} --flavor production + flutter build appbundle --release --build-number=${{github.run_number}} --flavor production - name: Rename APK and AAB run: | mkdir -p build/app/outputs/android_artifacts - mv build/app/outputs/flutter-apk/app-production-${{ env.BUILD_MODE }}.apk "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.apk" - mv build/app/outputs/bundle/${{ env.AAB_PATH }}/app-production-${{ env.BUILD_MODE }}.aab "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.aab" + mv build/app/outputs/flutter-apk/app-production-release.apk "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.apk" + mv build/app/outputs/bundle/productionRelease/app-production-release.aab "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.aab" - name: Archive Android artifacts uses: actions/upload-artifact@v4.0.0