name: Build Fladder on: push: tags: - "v*" branches: - master pull_request: paths: - pubspec.yaml - .github/workflows/build.yml - .fvmrc types: - opened - reopened workflow_dispatch: jobs: fetch-info: runs-on: ubuntu-latest outputs: version_name: ${{ steps.fetch.outputs.version_name }} flutter_version: ${{ steps.fetch.outputs.flutter_version }} steps: - name: Checkout repository uses: actions/checkout@v4.1.1 - name: Fetch version name id: fetch run: | # Extract version_name from pubspec.yaml VERSION_NAME=$(grep '^version:' pubspec.yaml | cut -d ':' -f2 | cut -d '+' -f1 | tr -d ' ') echo "version_name=${VERSION_NAME}" >> "$GITHUB_OUTPUT" # Extract flutter_version from .fvmrc FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc) echo "flutter_version=${FLUTTER_VERSION}" >> "$GITHUB_OUTPUT" # Print flutter version for logging echo "Flutter version: $FLUTTER_VERSION" shell: bash build-android: needs: [fetch-info] runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4.1.1 - name: Determine Build Type run: | if [[ "${{ startsWith(github.ref, 'refs/tags/v') }}" == "true" ]]; then echo "BUILD_MODE=release" >> $GITHUB_ENV echo "ARTIFACT_SUFFIX=release-signed" >> $GITHUB_ENV echo "AAB_PATH=productionRelease" >> $GITHUB_ENV else echo "BUILD_MODE=profile" >> $GITHUB_ENV echo "ARTIFACT_SUFFIX=production" >> $GITHUB_ENV echo "AAB_PATH=productionProfile" >> $GITHUB_ENV fi - name: Decode Keystore for release if: startsWith(github.ref, 'refs/tags/v') env: ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} GITHUB_RUN_NUMBER: ${{ github.run_number }} run: | echo "$ENCODED_STRING" | base64 -d > android/app/keystore.jks # Create the key.properties file cat > android/app/key.properties <