From dc0c1db7799110776ff5fca590bc1ede0dcc31ae Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Tue, 7 May 2024 23:22:51 +0800 Subject: [PATCH] enable git lfs cache to avoid billing according to https://github.com/actions/checkout/issues/165 --- .github/workflows/auto-build.yml | 14 +++++++++++--- .github/workflows/release.yml | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index e6a64c7..fc4e99a 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -29,10 +29,18 @@ jobs: - name: Checkout codes uses: actions/checkout@v2 with: - lfs: true submodules: recursive - - name: Checkout LFS - run: git lfs checkout + - name: Checkout LFS file list + run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id + - name: LFS Cache + uses: actions/cache@v3 + with: + path: .git/lfs/objects + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + ${{ runner.os }}-lfs- + - name: Git LFS Pull + run: git lfs pull - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e82d242..358394d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,10 +32,18 @@ jobs: - name: Checkout codes uses: actions/checkout@v2 with: - lfs: true submodules: recursive - - name: Checkout LFS - run: git lfs checkout + - name: Checkout LFS file list + run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id + - name: LFS Cache + uses: actions/cache@v3 + with: + path: .git/lfs/objects + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + ${{ runner.os }}-lfs- + - name: Git LFS Pull + run: git lfs pull - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: