From 0f9e351e345b1ea83135cbbe140ceb17accb0f24 Mon Sep 17 00:00:00 2001 From: lirtual Date: Sat, 21 Dec 2024 23:22:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DFFmpeg=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/optimize-assets.yml | 30 +++++++++------------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/optimize-assets.yml b/.github/workflows/optimize-assets.yml index 9faf9263f9b..c081c9e27ca 100644 --- a/.github/workflows/optimize-assets.yml +++ b/.github/workflows/optimize-assets.yml @@ -23,31 +23,21 @@ jobs: id: cache-ffmpeg uses: actions/cache@v3 with: - path: ~/.ffmpeg - key: ${{ runner.os }}-ffmpeg-${{ hashFiles('.github/workflows/optimize-assets.yml') }} - restore-keys: | - ${{ runner.os }}-ffmpeg- + path: ~/ffmpeg + key: ${{ runner.os }}-ffmpeg-static-6.1 - name: Install FFmpeg if: steps.cache-ffmpeg.outputs.cache-hit != 'true' run: | - sudo apt-get update - sudo apt-get install -y ffmpeg - mkdir -p ~/.ffmpeg - cp $(which ffmpeg) ~/.ffmpeg/ + mkdir -p ~/ffmpeg + wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz + tar xf ffmpeg-release-amd64-static.tar.xz + mv ffmpeg-*-amd64-static/ffmpeg ~/ffmpeg/ + mv ffmpeg-*-amd64-static/ffprobe ~/ffmpeg/ + rm -rf ffmpeg-*-amd64-static* - - name: Setup FFmpeg from cache - if: steps.cache-ffmpeg.outputs.cache-hit == 'true' - run: | - mkdir -p ~/.ffmpeg - sudo cp ~/.ffmpeg/ffmpeg /usr/local/bin/ - sudo chmod +x /usr/local/bin/ffmpeg - # 验证 FFmpeg 是否可用 - ffmpeg -version || { - echo "Cached FFmpeg is not working, falling back to fresh install" - sudo apt-get update - sudo apt-get install -y ffmpeg - } + - name: Add FFmpeg to PATH + run: echo "$HOME/ffmpeg" >> $GITHUB_PATH # 添加 node_modules 缓存 - name: Cache node_modules