Skip to content
36 changes: 34 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: true
android: false
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 @@ -37,6 +54,19 @@ jobs:
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable

- name: Clean Flutter project
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: Show disk usage after cleanup
run: df -h /

- name: Decode Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }}
Expand Down Expand Up @@ -77,6 +107,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 +119,7 @@ jobs:
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: ${{ env.APK_PATH }}
artifacts: ${{ env.APK_RELEASE_PATH }}
artifactContentType: apk
generateReleaseNotes: true
tag: latest_build
tag: latest_build