File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,40 @@ inputs:
2626runs :
2727 using : composite
2828 steps :
29+ - name : Check if mc is installed
30+ id : check-mc
31+ run : |
32+ if [[ -n "$(which mc)" ]]; then
33+ echo "exists=true" >> "$GITHUB_OUTPUT"
34+ else
35+ echo "exists=false" >> "$GITHUB_OUTPUT"
36+ fi
37+ shell : bash
38+
39+ - name : Download latest mc SHA256
40+ id : mc-sha
41+ if : ${{ steps.check-mc.outputs.exists == 'false' }}
42+ run : |
43+ sha=$(wget -qO- \
44+ https://dl.min.io/client/mc/release/linux-amd64/mc.sha256sum \
45+ | awk '{print $1}')
46+ echo "sha256=$sha" >> "$GITHUB_OUTPUT"
47+ shell : bash
48+
49+ - name : Cache mc binary
50+ id : cache-mc
51+ if : ${{ steps.check-mc.outputs.exists == 'false' }}
52+ uses : actions/cache@v4
53+ with :
54+ path : /usr/local/bin/mc
55+ key : mc-${{ steps.mc-sha.outputs.sha256 }}
56+
2957 - name : Setup mc
3058 working-directory : /usr/local/bin
59+ if : >-
60+ ${{ steps.check-mc.outputs.exists == 'false'
61+ && steps.cache-mc.outputs.cache-hit != 'true' }}
3162 run : |
32- [ -n "$(which mc)" ] && exit 0
3363 arch=$(dpkg --print-architecture | sed 's/armhf/arm/g')
3464 sudo wget --progres=dot:binary \
3565 "https://dl.min.io/client/mc/release/linux-${arch}/mc"
You can’t perform that action at this time.
0 commit comments