diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cfdce3..1a8dc45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: access-key: ${{ secrets.AWS_ACCESS_KEY }} secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} local-path: "./files/test1.txt" - remote-path: "github/minio/" + remote-path: "nbfc-assets/github/minio/" - name: Test wildcard with extension upload uses: ./ @@ -31,7 +31,7 @@ jobs: access-key: ${{ secrets.AWS_ACCESS_KEY }} secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} local-path: "./files/*.txt" - remote-path: "github/minio/" + remote-path: "nbfc-assets/github/minio/" - name: Test wildcard upload uses: ./ @@ -40,4 +40,4 @@ jobs: access-key: ${{ secrets.AWS_ACCESS_KEY }} secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} local-path: "./files/*" - remote-path: "github/minio/" + remote-path: "nbfc-assets/github/minio/" diff --git a/action.yml b/action.yml index a32f14d..0e790b6 100644 --- a/action.yml +++ b/action.yml @@ -26,10 +26,40 @@ inputs: runs: using: composite steps: + - name: Check if mc is installed + id: check-mc + run: | + if [[ -n "$(which mc)" ]]; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi + shell: bash + + - name: Download latest mc SHA256 + id: mc-sha + if: ${{ steps.check-mc.outputs.exists == 'false' }} + run: | + sha=$(wget -qO- \ + https://dl.min.io/client/mc/release/linux-amd64/mc.sha256sum \ + | awk '{print $1}') + echo "sha256=$sha" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Cache mc binary + id: cache-mc + if: ${{ steps.check-mc.outputs.exists == 'false' }} + uses: actions/cache@v4 + with: + path: /usr/local/bin/mc + key: mc-${{ steps.mc-sha.outputs.sha256 }} + - name: Setup mc working-directory: /usr/local/bin + if: >- + ${{ steps.check-mc.outputs.exists == 'false' + && steps.cache-mc.outputs.cache-hit != 'true' }} run: | - [ -n "$(which mc)" ] && exit 0 arch=$(dpkg --print-architecture | sed 's/armhf/arm/g') sudo wget --progres=dot:binary \ "https://dl.min.io/client/mc/release/linux-${arch}/mc"