File tree Expand file tree Collapse file tree
.github/actions/universal-package Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ runs:
5353
5454 echo '::endgroup::'
5555
56- - name : Cache keg
57- id : cache-keg
58- uses : actions/cache@v4
56+ - name : Restore keg cache
57+ id : cache-keg-restore
58+ uses : actions/cache/restore @v4
5959 with :
6060 path : ${{ steps.setup-formula.outputs.brew_prefix }}/Cellar/${{ inputs.formula }}
6161 key : ${{ inputs.formula }}-homebrew-cache-custom-unified-prefix${{ steps.setup-formula.outputs.brew_prefix }}-xcode${{ steps.setup-formula.outputs.xcode_version }}-${{ hashFiles(format('{0}.rb', inputs.formula)) }}
6262
6363 - name : Install formula
64+ id : install-formula
6465 shell : bash
6566 run : |
6667 echo '::group::Install formula'
9394 done
9495
9596 echo '::endgroup::'
97+
98+ - name : Save keg cache
99+ id : cache-keg-save
100+ uses : actions/cache/save@v4
101+ # We always save the generated artifact even if the whole run
102+ # fails due to other issues. This helps debugging build
103+ # failure issues faster if the cache doesn't already exist as
104+ # we want subsequent runs to not have to re-generate this
105+ # artifact again.
106+ if : always() && steps.cache-keg-restore.outputs.cache-hit != 'true' && steps.install-formula.conclusion == 'success'
107+ with :
108+ path : ${{ steps.setup-formula.outputs.brew_prefix }}/Cellar/${{ inputs.formula }}
109+ key : ${{ steps.cache-keg-restore.outputs.cache-primary-key }}
You can’t perform that action at this time.
0 commit comments