From 8127c55d30f0034cd70c7538f8af23ec0930deee Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:33:27 +0200 Subject: [PATCH] feat(actions): caching --- .github/workflows/build.yml | 88 +++++++++++++++++++++++++++++++++++++ windows/build-installer.ps1 | 4 +- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77e9f318..a0894bfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,26 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true + + - name: Cache Pub dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Install dependencies run: flutter pub get @@ -48,6 +68,27 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true + + - name: Cache Pub dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- + + - name: Cache CocoaPods + uses: actions/cache@v4 + with: + path: | + ios/Pods + ~/Library/Caches/CocoaPods + ~/.cocoapods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- - name: Install dependencies run: flutter pub get @@ -76,6 +117,27 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true + + - name: Cache Pub dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- + + - name: Cache CocoaPods + uses: actions/cache@v4 + with: + path: | + macos/Pods + ~/Library/Caches/CocoaPods + ~/.cocoapods + key: ${{ runner.os }}-macos-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-macos-pods- - name: Install dependencies run: flutter pub get @@ -103,6 +165,16 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true + + - name: Cache Pub dependencies + uses: actions/cache@v4 + with: + path: | + ~\AppData\Local\Pub\Cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- - name: Install dependencies run: flutter pub get @@ -134,6 +206,22 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true + + - name: Cache Pub dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- + + - name: Cache APT packages + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv + version: 1.0 - name: Install Linux dependencies run: | diff --git a/windows/build-installer.ps1 b/windows/build-installer.ps1 index ef5371b4..282a38ab 100644 --- a/windows/build-installer.ps1 +++ b/windows/build-installer.ps1 @@ -18,8 +18,8 @@ Set-Location $ProjectRoot # Define paths $BuildDir = "build\windows\x64\runner\Release" -$PortableZip = Join-Path $OutputDir "plezy-windows-portable.zip" -$InstallerExe = Join-Path $OutputDir "plezy-windows-installer.exe" +$PortableZip = Join-Path (Resolve-Path $OutputDir) "plezy-windows-portable.zip" +$InstallerExe = Join-Path (Resolve-Path $OutputDir) "plezy-windows-installer.exe" $SetupScript = "setup.iss" # Check if build exists