From de96f6f36f9fe3be8194e325938158753bc6d19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Trung=20Hi=E1=BA=BFu?= Date: Wed, 8 Jul 2026 09:03:20 +0700 Subject: [PATCH] ci: cache KeePass download - Use actions/cache to cache the extracted KeePass directory. - Only download KeePass from SourceForge on cache miss. - Verify KeePass.exe exists before exporting KEEPASS_DIR. Closes #37. --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc26194..da15300 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,15 @@ jobs: with: dotnet-version: "8.0.x" + - name: Cache KeePass + id: cache-keepass + uses: actions/cache@v4 + with: + path: ${{ runner.temp }}\KeePass + key: keepass-2.61.1-${{ runner.os }} + - name: Download KeePass + if: steps.cache-keepass.outputs.cache-hit != 'true' shell: powershell run: | $keepassDir = Join-Path $env:RUNNER_TEMP "KeePass" @@ -47,6 +55,13 @@ jobs: throw "KeePass.exe was not extracted." } + - name: Export KeePass directory + shell: powershell + run: | + $keepassDir = Join-Path $env:RUNNER_TEMP "KeePass" + if (!(Test-Path (Join-Path $keepassDir "KeePass.exe"))) { + throw "KeePass.exe is not available." + } "KEEPASS_DIR=$keepassDir" | Out-File -FilePath $env:GITHUB_ENV -Append - name: Run tests