diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 48deace9..542cd10a 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -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 + + - name: Show disk usage after cleanup + run: df -h / + - name: Setup Java uses: actions/setup-java@v4 with: @@ -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 }} @@ -77,17 +107,20 @@ jobs: needs: build_android permissions: contents: write + env: + APK_RELEASE_PATH: apk-release/*.apk steps: - name: Download APK artifact uses: actions/download-artifact@v4 with: name: apk-release + path : apk-release - name: Deploy to GitHub Release uses: ncipollo/release-action@v1.14.0 with: allowUpdates: true - artifacts: ${{ env.APK_PATH }} + artifacts: ${{ env.APK_RELEASE_PATH }} artifactContentType: apk generateReleaseNotes: true - tag: latest_build + tag: latest_build \ No newline at end of file