Skip to content
32 changes: 30 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Show disk usage before cleanup
run: df -h /

- name: Free disk space on runner
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
Comment on lines +35 to +39
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.


- name: Show disk usage after cleanup
run: df -h /

- name: Setup Java
uses: actions/setup-java@v4
with:
Expand All @@ -38,6 +55,15 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}

- name: Clean previous build and caches
run: |
flutter clean
rm -rf build
cd android && ./gradlew clean && cd -
rm -rf ~/.gradle/caches
rm -rf ~/.gradle/daemon
rm -rf ~/.android/build-cache

- name: Decode Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }}

Expand Down Expand Up @@ -77,6 +103,8 @@ jobs:
needs: build_android
permissions:
contents: write
env:
APK_RELEASE_PATH: apk-release/app-release.apk
steps:
- name: Download APK artifact
uses: actions/download-artifact@v4
Expand All @@ -87,7 +115,7 @@ jobs:
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: ${{ env.APK_PATH }}
artifactContentType: apk
artifacts: ${{ env.APK_RELEASE_PATH }}
artifactContentType: application/vnd.android.package-archive
generateReleaseNotes: true
tag: latest_build