Skip to content

Conversation

@uju09
Copy link
Contributor

@uju09 uju09 commented Nov 13, 2025

Description

This PR fixes the broken release job of Build and Deploy workflow.

Fixes #539

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

Summary by CodeRabbit

  • Chores
    • Improved Android build workflow with enhanced disk space management and cleanup procedures to support more reliable builds.
    • Optimized APK artifact handling and deployment configuration for better build process efficiency.

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The Build and Deploy GitHub Actions workflow is fixed by adding disk space management, implementing proper cache cleanup, and updating artifact path handling to use an environment variable (APK_RELEASE_PATH) alongside a corrected MIME type for Android package releases.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow
.github/workflows/build_and_deploy.yml
Added disk housekeeping steps (usage reporting and free-disk-space action), implemented pre-build cleanup block (flutter clean, Gradle cache removal), introduced APK_RELEASE_PATH environment variable for artifact propagation, updated artifact content type to application/vnd.android.package-archive, and replaced APK_PATH with APK_RELEASE_PATH in deployment references.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Disk cleanup steps: Verify free-disk-space action configuration and resource flags are appropriate for Android builds.
  • Cache cleanup block: Confirm flutter clean and cache removal paths align with current project structure.
  • Environment variable handling: Ensure APK_RELEASE_PATH propagation is correctly scoped across deployment steps and artifact uploads.
  • MIME type update: Validate that application/vnd.android.package-archive is the correct content type for Google Play Store submission.

Possibly related PRs

Suggested reviewers

  • M4dhav

Poem

🐰 Disks cleaned and caches swept away,
APK paths now find their way,
With proper MIME types in place,
The workflow runs a cleaner race!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references fixing APK release but is awkwardly phrased with passive voice and lacks specificity about what was broken or how it was fixed. Clarify the title to be more specific and active, e.g., 'fix: Restore Build and Deploy workflow for APK release' or 'fix: Add disk cleanup and APK artifact configuration for releases'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The changes address the core objective from issue #539 by fixing the Build and Deploy workflow with disk cleanup, proper artifact handling, and environment variable propagation for APK releases.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Build and Deploy workflow; disk housekeeping, cleanup steps, artifact paths, and content-type updates are all necessary for the workflow to function properly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 @uju09!
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! 🚀

@uju09
Copy link
Contributor Author

uju09 commented Nov 13, 2025

@M4dhav I request you to review.

@M4dhav M4dhav self-requested a review November 14, 2025 07:39
@M4dhav M4dhav added the bug Something isn't working label Nov 14, 2025
@M4dhav M4dhav linked an issue Nov 14, 2025 that may be closed by this pull request
@M4dhav
Copy link
Contributor

M4dhav commented Nov 14, 2025

Please follow the specified PR template and don't overwrite it in the future

@M4dhav
Copy link
Contributor

M4dhav commented Nov 14, 2025

Please test the workflow locally and share a video

Copy link
Contributor

@M4dhav M4dhav left a comment

Choose a reason for hiding this comment

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

Waiting for test video

@uju09
Copy link
Contributor Author

uju09 commented Nov 14, 2025

@M4dhav Sorry for PR body. I forgot.

@uju09
Copy link
Contributor Author

uju09 commented Nov 14, 2025

@M4dhav I don't have secrets with me. Testing it locally is not possible.

@M4dhav
Copy link
Contributor

M4dhav commented Nov 14, 2025

You can setup your own secrets locally on your fork

@uju09
Copy link
Contributor Author

uju09 commented Nov 14, 2025

Where to get secrets. I am in Web dev. I don't know much about App dev and its release.

@uju09
Copy link
Contributor Author

uju09 commented Nov 14, 2025

@M4dhav Can you test it on test branch. I request you.

@M4dhav
Copy link
Contributor

M4dhav commented Nov 14, 2025

Where to get secrets. I am in Web dev. I don't know much about App dev and its release.

All of the secrets are self explanatory, and as this is for GitHub Release, you don't need credentials for an App Console account. You will be able to easily find where to generate which secret.

@M4dhav
Copy link
Contributor

M4dhav commented Nov 14, 2025

Can you test it on test branch. I request you.

I'm sorry, I do not have the time right now to do so

@uju09
Copy link
Contributor Author

uju09 commented Nov 14, 2025

@M4dhav Ok give me some time. I will try and share a video.

@uju09
Copy link
Contributor Author

uju09 commented Nov 25, 2025

@M4dhav I request you to test the workflow.

uju09 added 3 commits December 1, 2025 21:14
Signed-off-by: uju09 <[email protected]>
Signed-off-by: uju09 <[email protected]>
@uju09
Copy link
Contributor Author

uju09 commented Dec 1, 2025

@coderabbitai Review.

@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

@uju09: I'll review the changes in this PR for you.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 0

🧹 Nitpick comments (1)
.github/workflows/build_and_deploy.yml (1)

27-42: Approve disk housekeeping; consider pinning the action version.

The disk space cleanup steps are well-placed and should resolve common CI/CD runner failures. The disk usage visibility aids debugging.

However, the free-disk-space@main action is unpinned to a specific version. This can cause reproducibility issues if the action changes behavior in the future.

Consider pinning to a specific version tag:

-        uses: jlumbroso/free-disk-space@main
+        uses: jlumbroso/[email protected]

You can check the latest stable version at https://github.com/jlumbroso/free-disk-space/releases.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b90b2e and 5b98286.

📒 Files selected for processing (1)
  • .github/workflows/build_and_deploy.yml (4 hunks)
🔇 Additional comments (2)
.github/workflows/build_and_deploy.yml (2)

58-65: Good placement and scope of build cleanup step.

The cleanup step is well-positioned after Flutter setup but before artifact builds, and comprehensively removes Flutter, Gradle, and cache artifacts. This should eliminate stale build cache issues.


106-119: Verify APK artifact path resolution and MIME type update.

The APK_RELEASE_PATH environment variable and MIME type update appear correct:

  • Path apk-release/app-release.apk should align with the upload structure (artifact name + filename)
  • MIME type application/vnd.android.package-archive is the standard type for Android packages

However, verification requires access to the workflow file's upload configuration (lines 94-98) to confirm that the artifact download on lines 110–112 places files in the expected apk-release/ directory so the path resolves correctly at release time. Specifically, verify that the upload step uses name: apk-release and that the file app-release.apk will be in the correct nested directory after download.

Comment on lines +35 to +39
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even have any of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had no idea what we have, so I thought to give it a try, and also it is future proof to clear the disk storage.

Comment on lines 93 to 119
artifactContentType: apk
artifactContentType: application/vnd.android.package-archive
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This came by mistake, in cursor there was an syntax error and I pressed tab for autocompletion, it may be incurred at that time.

@M4dhav
Copy link
Contributor

M4dhav commented Dec 2, 2025

Failed with a different error: un android-actions/setup-android@v3
with:
cmdline-tools-version: 12266719
accept-android-sdk-licenses: true
log-accepted-android-sdk-licenses: true
packages: tools platform-tools
env:
JAVA_VERSION: 21.0.6
FLUTTER_VERSION: 3.35.2
APK_PATH: build/app/outputs/flutter-apk/app-release.apk
KEYSTORE_PATH: android/upload-keystore.jks
KEY_PROPS_PATH: android/key.properties
FIREBASE_OPTIONS_PATH: lib/firebase_options.dart
GOOGLE_SERVICES_ANDROID_PATH: android/app/google-services.json
APPWRITE_PROJECT_ID: ***
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/21.0.6-7/x64
JAVA_HOME_21_X64: /opt/hostedtoolcache/Java_Zulu_jdk/21.0.6-7/x64
Downloading commandline tools from https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip
node:internal/fs/promises:858
return await PromisePrototypeThen(
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/android'
at async Object.mkdir (node:internal/fs/promises:858:10) {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/android'
}
Node.js v20.19.5

I believe this is becuase we are deleting android

@uju09
Copy link
Contributor Author

uju09 commented Dec 2, 2025

@M4dhav I will fix it.

@uju09
Copy link
Contributor Author

uju09 commented Dec 2, 2025

@M4dhav I removed that cleaning job, I think it is disturbing the flow, however the job of cleaning cache and previous build is still there.

@uju09 uju09 requested a review from M4dhav December 2, 2025 07:02
Copy link
Contributor

@M4dhav M4dhav left a comment

Choose a reason for hiding this comment

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

Getting the same error as last time. Add back the previous cleaning job but remove some of the parts like android set to false

@M4dhav
Copy link
Contributor

M4dhav commented Dec 2, 2025

Getting the same error as last time.

Space error

@uju09
Copy link
Contributor Author

uju09 commented Dec 2, 2025

@M4dhav Changes have been made.

@uju09 uju09 requested a review from M4dhav December 2, 2025 10:15
Copy link
Contributor

@M4dhav M4dhav left a comment

Choose a reason for hiding this comment

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

Workflow ran, but got this warning during second job and no builds were uploaded:

Image

@uju09
Copy link
Contributor Author

uju09 commented Dec 2, 2025

@M4dhav I think the name of file was wrong, I will fix it.

@uju09
Copy link
Contributor Author

uju09 commented Dec 2, 2025

@M4dhav There was a typo, Now it will succeed.

@uju09 uju09 requested a review from M4dhav December 2, 2025 12:57
Copy link
Contributor

@M4dhav M4dhav left a comment

Choose a reason for hiding this comment

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

Image

Errors like these will keep happening if you keep committing AI generated code without looking it over

@uju09
Copy link
Contributor Author

uju09 commented Dec 3, 2025

@M4dhav I am sorry for irritating. Due to consistent errors, I took suggestions from AI and my seniors and updated the release action version to latest. It is my fault, I would have checked earlier whether it is right or not. I apologize for that. Don't know why but this workflow is taking too much time, though it should not take, but it is giving trouble and all types of errors, so I was trying to analyse it from every angle.

@uju09
Copy link
Contributor Author

uju09 commented Dec 3, 2025

@M4dhav Now I think everything is fine... and it should do its job.

@M4dhav
Copy link
Contributor

M4dhav commented Dec 3, 2025

@M4dhav I am sorry for irritating. Due to consistent errors, I took suggestions from AI and my seniors and updated the release action version to latest. It is my fault, I would have checked earlier whether it is right or not. I apologize for that. Don't know why but this workflow is taking too much time, though it should not take, but it is giving trouble and all types of errors, so I was trying to analyse it from every angle.

It is alright.

The workflow is working fine now.

Could you make a few more modifications please? The Build Tag and Release Notes should be fetched from the Changelog

@uju09
Copy link
Contributor Author

uju09 commented Dec 5, 2025

@M4dhav Hey, I think we should write our CHANGELOG.md in order of latest version. Currently the latest version is at last, can we modify it , so it becomes easy for contributors and for job too for parsing.

@uju09
Copy link
Contributor Author

uju09 commented Dec 5, 2025

Should we make a script for parsing or it should be added within workflow? Which approach to follow?
Screenshot 2025-12-05 at 1 27 16 PM
Screenshot 2025-12-05 at 1 30 20 PM

@M4dhav
Copy link
Contributor

M4dhav commented Dec 9, 2025

@M4dhav Hey, I think we should write our CHANGELOG.md in order of latest version. Currently the latest version is at last, can we modify it , so it becomes easy for contributors and for job too for parsing.

If that is the case, then sure, we can have it top to bottom. Please feel free to raise a PR for the same

@uju09
Copy link
Contributor Author

uju09 commented Dec 9, 2025

@M4dhav Ok then I will create an issue. Currently I am busy with my internship, I am will try to resolve all assigned issue as soon as possible.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Build and Deploy workflow

2 participants