diff --git a/.github/actions/cache-gradle-build/action.yml b/.github/actions/cache-gradle-build/action.yml index 73a01e4..d930bfb 100644 --- a/.github/actions/cache-gradle-build/action.yml +++ b/.github/actions/cache-gradle-build/action.yml @@ -10,9 +10,9 @@ outputs: cache-hit: description: Whether an exact cache key match was restored value: ${{ steps.cache.outputs.cache-hit }} - cache-primary-key: - description: Primary cache key to pass to the save action after the build - value: ${{ steps.cache.outputs.cache-primary-key }} + cache-save-scope: + description: Scope to pass to the save action (always this job's scope, not a restored fallback key) + value: ${{ inputs.scope }} runs: using: composite diff --git a/.github/actions/save-gradle-build-cache/action.yml b/.github/actions/save-gradle-build-cache/action.yml index 2e50405..c5bf84c 100644 --- a/.github/actions/save-gradle-build-cache/action.yml +++ b/.github/actions/save-gradle-build-cache/action.yml @@ -2,8 +2,8 @@ name: Save Gradle build directories description: Save project .gradle/, build/ trees after a Gradle build inputs: - primary-key: - description: cache-primary-key from cache-gradle-build restore step + scope: + description: Same scope passed to cache-gradle-build (save always uses this job's key, not a restored fallback key) required: true runs: @@ -12,7 +12,7 @@ runs: - uses: actions/cache/save@v5 continue-on-error: true with: - key: ${{ inputs.primary-key }} + key: gradle-build-${{ runner.os }}-${{ runner.arch }}-v2-${{ inputs.scope }}-${{ hashFiles('gradle/libs.versions.toml', 'settings.gradle.kts', 'gradle.properties', 'build.gradle.kts', 'app/desktop/build.gradle.kts', 'app/desktop/proguard-rules.pro', 'app/shared/build.gradle.kts', 'app/android/build.gradle.kts', 'utils/shared/build.gradle.kts', 'utils/android/build.gradle.kts') }} path: | .gradle build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbc8159..9dff842 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -119,7 +119,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} - uses: actions/upload-artifact@v5 with: name: desktop-proguard @@ -170,7 +170,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} windows-package: name: Windows (${{ matrix.label }}) @@ -246,7 +246,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} macos: name: macOS (${{ matrix.label }}) @@ -316,7 +316,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} linux: name: Linux (${{ matrix.label }}) @@ -382,7 +382,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} android: name: Android @@ -441,7 +441,7 @@ jobs: - uses: ./.github/actions/save-gradle-build-cache if: always() with: - primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }} + scope: ${{ steps.gradle-build-cache.outputs.cache-save-scope }} - name: Stage APK run: | mkdir -p release-staging