Skip to content

Conversation

@dimension-drifter
Copy link

@dimension-drifter dimension-drifter commented Dec 13, 2025

Description

Fixed the broken Build and Deploy workflow by adding necessary configuration steps and updating versions to match the current project setup.

Problem

The workflow was failing due to:

  1. Missing local.properties file - Required by the new Gradle Kotlin DSL configuration in settings.gradle.kts which expects flutter.sdk path
  2. Invalid Flutter version - Version 3.35.2 doesn't exist; updated to 3.27.2 (latest stable)
  3. Incorrect APK path reference - The deploy_github_release job referenced an env variable that wasn't in scope
  4. Missing versioning configuration - flutter.versionName and flutter.versionCode weren't being set for Gradle builds

Changes Made

1. Build and Deploy Workflow (.github/workflows/build_and_deploy.yml)

  • Added local.properties creation step with proper Flutter SDK path and Android SDK configuration
  • Updated Flutter version from 3.35.2 to 3.27.2 (latest stable)
  • Fixed Java version format from 21.0.6 to 21 for better compatibility
  • Fixed APK path reference in deploy job (moved to job-level env variable)
  • Added versioning information from git context
  • Added Flutter cache for faster builds
  • Improved artifact retention settings
  • Fixed artifact content type for APK
  • Enhanced release notes with commit and build information

2. Store Deploy Workflow (.github/workflows/store_deploy_android.yml)

  • Added local.properties creation step with version extraction from pubspec.yaml
  • Updated Flutter version to 3.27.2
  • Fixed Java version format
  • Added Flutter cache for faster builds
  • Improved artifact retention settings
  • Added status: completed to Play Store upload for proper release status

Summary by CodeRabbit

  • Chores
    • Updated build environment versions and enabled caching for faster builds.
    • Enhanced release artifact handling with retention policies and improved metadata.
    • Improved build configuration management for Android deployments.
    • Updated deployment workflow to support manual triggering and better version tracking.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

Walkthrough

This PR updates three GitHub Actions workflows to standardize environment versions (Java to "21", Flutter to "3.27.2"), enable build caching, generate android/local.properties dynamically with build metadata, add artifact retention policies, and enhance release notes with branch and commit information. Additionally, .gitignore patterns are updated.

Changes

Cohort / File(s) Summary
Workflow environment & caching updates
.github/workflows/build_and_deploy.yml, .github/workflows/run_tests.yml, .github/workflows/store_deploy_android.yml
Updated Java version (21.0.6 → "21") and Flutter version (3.35.2 → "3.27.2") across all three workflows. Enabled Flutter setup caching. Added step to generate android/local.properties with sdk.dir, flutter.sdk, flutter.buildMode, flutter.versionName, and flutter.versionCode entries.
Release artifact & deployment enhancements
.github/workflows/build_and_deploy.yml
Added 30-day retention policy for APK artifacts. Introduced version derivation step from pubspec.yaml with GitHub outputs. Changed artifact content type to application/vnd.android.package-archive. Enhanced release metadata with "Latest Build" name and body containing branch, commit, and build number.
Store deployment workflow improvements
.github/workflows/store_deploy_android.yml
Enabled manual workflow trigger via workflow_dispatch. Added environment variables (SERVICE_ACCOUNT_PATH, FIREBASE_OPTIONS_PATH, GOOGLE_SERVICES_ANDROID_PATH, APPWRITE_PROJECT_ID). Applied 30-day retention to AAB deployment artifacts. Added completion status check to Play Store deployment step.
Configuration updates
.gitignore
Added ignore patterns: aossie-org-resonate-8a5edab282632443.txt and .github/instructions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Heterogeneous changes across three workflow files with distinct modifications to each (version updates, caching, local.properties generation, retention policies, version derivation, and environment variables)
  • Local.properties generation logic should be verified for correct property references and environment variable interpolation
  • Release metadata formatting and version derivation from pubspec.yaml warrant careful inspection
  • Consistency of environment variable definitions across multiple workflows

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • M4dhav

Poem

🐰 With caches spun and versions set,
The workflows hop and never fret,
Local properties bloom in place,
CI/CD runs at rabbit pace!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the PR, which is to fix a broken Build and Deploy workflow by addressing missing configurations and version updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🎉 Welcome @dimension-drifter!
Thank you for your pull request! Our team will review it soon. 🔍

  • Please ensure your PR follows the contribution guidelines. ✅
  • All automated tests should pass before merging. 🔄
  • If this PR fixes an issue, link it in the description. 🔗

We appreciate your contribution! 🚀

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/build_and_deploy.yml (1)

14-48: Flutter 3.27.2 is outdated and has documented build issues—verify version choice intentionality.
Flutter 3.27.2 is not the current latest stable as of December 2025 (Flutter 3.38.1 is current, documented as of Nov 12, 2025). Version 3.27.2 has known issues around impeller and emulator/Windows/iOS builds. The project lacks explicit version pinning (no .fvmrc file and pubspec.yaml does not constrain Flutter version), so the workflow's hardcoded FLUTTER_VERSION: "3.27.2" is the only version specification. Confirm whether this pinning is intentional (e.g., for compatibility) or should be updated to a current stable release.

The local local.properties generation logic is correct and aligns with Gradle expectations.

.github/workflows/run_tests.yml (1)

18-45: Create android/ directory defensively before writing local.properties.

The android/ directory may not exist when the script runs, causing the echo commands to fail. Add mkdir -p android at the start of the script to ensure it exists.

Note: ANDROID_SDK_ROOT is provided by default on ubuntu-latest runners, and FLUTTER_ROOT is set by subosito/flutter-action@v2, so both environment variables will be available. The suggested parameter expansion checks and fallback logic are not necessary.

       - name: Create local.properties
         run: |
+          mkdir -p android
           echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
           echo "flutter.sdk=$FLUTTER_ROOT" >> android/local.properties
🧹 Nitpick comments (1)
.github/workflows/store_deploy_android.yml (1)

50-60: Improve pubspec version parsing robustness with validation.

Current parsing works for the existing 3.0.0+7 version format, but the chain of grep | cut | tr is fragile and lacks validation. The proposed improvements are beneficial defensive practices:

  • Use awk for cleaner version extraction
  • Add explicit validation that VERSION_CODE is numeric and present
  • Enable set -euo pipefail to catch unset variables
  • Quote variables properly for shell safety
  • Ensure android/ directory exists before writing

The diff provided implements these improvements correctly and should be applied.

Note: The workflow also uses r0adkll/upload-google-play@v1 with status: completed (line 109), which is valid and correct for internal track uploads.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b063ecb and af7dfce.

📒 Files selected for processing (4)
  • .github/workflows/build_and_deploy.yml (3 hunks)
  • .github/workflows/run_tests.yml (2 hunks)
  • .github/workflows/store_deploy_android.yml (4 hunks)
  • .gitignore (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: M4dhav
Repo: AOSSIE-Org/Resonate PR: 510
File: .github/workflows/build_and_deploy.yml:31-36
Timestamp: 2025-08-31T16:18:53.594Z
Learning: For the AOSSIE-Org/Resonate project, build system requirements like Java version setup are considered separate from dependency update PRs and should be handled in dedicated PRs focused on build system improvements.

Comment on lines 84 to +118
deploy_github_release:
name: Deploy to GitHub Release
runs-on: ubuntu-latest
needs: build_android
permissions:
contents: write
env:
APK_PATH: app-release.apk
steps:
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: apk-release
path: ./

- name: Get version from pubspec.yaml
id: version
run: |
VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')
echo "version=$VERSION" >> $GITHUB_OUTPUT
if: github.event_name == 'push'

- name: Deploy to GitHub Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: ${{ env.APK_PATH }}
artifactContentType: apk
artifactContentType: application/vnd.android.package-archive
generateReleaseNotes: true
tag: latest_build
name: Latest Build
body: |
Latest build from ${{ github.ref_name }} branch
Commit: ${{ github.sha }}
Build Number: ${{ github.run_number }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

actions/upload-artifact@v4 actions/download-artifact@v4 nested paths directory structure

💡 Result:

Short answer — how paths/structure work with actions/upload-artifact@v4 and actions/download-artifact@v4:

  • upload-artifact@v4

    • You give path(s) (file, dir, or glob). The action preserves the directory hierarchy relative to the upload root. If you pass multiple paths, the least common ancestor of those paths becomes the artifact root. If a glob contains a wildcard, the hierarchy is preserved only after the first wildcard (matching segments before the first wildcard are stripped). See README. [1]
  • download-artifact@v4

    • By default downloading multiple artifacts creates a subdirectory per artifact under the provided path (e.g., path/Artifact-A/... and path/Artifact-B/...). Use merge-multiple: true to merge contents of multiple artifacts into the same target directory. You can also download a single artifact by name or id to a specified path. v4 artifacts are job-scoped and not cross-compatible with v3/v2. See README and changelog. [2][3]

Examples

  • Upload a whole dir and preserve its tree:
    • upload path: my/dir/ -> artifact will contain my/dir/… relative structure. [1]
  • Upload with a glob that has a wildcard:
    • path/to//dir/.txt → uploaded files flattened to some/dir/foo.txt (segments before first * are removed). [1]
  • Download multiple artifacts into one folder:
    • download with merge-multiple: true and path: out/ → all artifact contents merged into out/. Otherwise each artifact gets its own subfolder. [2]

References

  1. actions/upload-artifact README (v4). [1]
  2. actions/download-artifact README / examples (v4). [2]
  3. GitHub Changelog — Artifacts v4 GA (notes on job-scoped artifacts and v4 incompatibility). [3]

🏁 Script executed:

# Find the build_android job to see how the artifact is uploaded
grep -A 50 "build_android:" .github/workflows/build_and_deploy.yml | head -80

Repository: AOSSIE-Org/Resonate

Length of output: 2058


🏁 Script executed:

# Check if pubspec.yaml is in the repository root
ls -la pubspec.yaml 2>/dev/null && echo "pubspec.yaml exists at root" || echo "pubspec.yaml not found at root"

Repository: AOSSIE-Org/Resonate

Length of output: 152


🏁 Script executed:

# Get the complete build_android job including the upload-artifact step
grep -A 150 "build_android:" .github/workflows/build_and_deploy.yml | grep -B 150 "deploy_github_release:" | head -100

Repository: AOSSIE-Org/Resonate

Length of output: 2721


Deploy job will fail: missing checkout for pubspec.yaml and incorrect APK artifact path.

The deploy_github_release job doesn't checkout the repository, causing the grep pubspec.yaml step to fail. Additionally, when build_android uploads build/app/outputs/flutter-apk/app-release.apk as a single file, download-artifact@v4 preserves the directory structure by default, placing the APK at build/app/outputs/flutter-apk/app-release.apk relative to the download path—not at the root. The APK_PATH: app-release.apk environment variable must be updated to reflect this.

  deploy_github_release:
    name: Deploy to GitHub Release
    runs-on: ubuntu-latest
    needs: build_android
    permissions:
      contents: write
    env:
-      APK_PATH: app-release.apk
+      APK_PATH: build/app/outputs/flutter-apk/app-release.apk
    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
       - name: Download APK artifact
         uses: actions/download-artifact@v4
         with:
           name: apk-release
           path: ./
🤖 Prompt for AI Agents
.github/workflows/build_and_deploy.yml lines 84-118: the deploy job fails
because it never checks out the repo before grepping pubspec.yaml and because
APK_PATH points to app-release.apk at repo root while download-artifact
preserves the original directory structure; add a checkout step (uses:
actions/checkout@v4) before the "Get version from pubspec.yaml" step so
pubspec.yaml is present, and update the env APK_PATH to the correct downloaded
location (build/app/outputs/flutter-apk/app-release.apk) so the release action
attaches the actual APK file.

Comment on lines +56 to +57
aossie-org-resonate-8a5edab282632443.txt
.github/instructions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Prefer a generalized ignore pattern (or add context) for the hash-like TXT file.
Ignoring a single specific filename is likely to go stale; consider ignoring a pattern (or adding a short comment explaining what generates it).

🤖 Prompt for AI Agents
In .gitignore around lines 56-57, the file
aossie-org-resonate-8a5edab282632443.txt is ignored by name which will become
stale; replace it with a generalized pattern such as aossie-org-resonate-*.txt
(or a regex-equivalent pattern) to catch future hash variants, or keep the
specific entry but add a short comment explaining what generates this filename
and why it's safe to ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant