From b8b0ae00d02470de59408d6cdbf9dc5c126128c6 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Wed, 3 Sep 2025 20:48:16 +0800 Subject: [PATCH] ci(release test):revert to cache linux --- .github/workflows/release-build.yml | 60 ++++++----------------------- 1 file changed, 11 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 1b0b2ae0..175bfd4c 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -18,7 +18,7 @@ jobs: uses: actions/cache/restore@v4 with: path: .sysroot/darwin.tar.gz - key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.2 + key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.3 lookup-only: true - name: Populate Darwin sysroot if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true' @@ -31,34 +31,9 @@ jobs: with: path: .sysroot/darwin.tar.gz key: ${{ steps.cache-darwin-sysroot.outputs.cache-primary-key }} - - populate-linux-sysroot: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v5 - - name: Check sysroot cache - id: cache-linux-sysroot - uses: actions/cache/restore@v4 - with: - path: .sysroot/linux.tar.gz - key: linux-sysroot-${{ hashFiles('.github/workflows/populate_linux_sysroot.sh') }}-0.0.2 - lookup-only: true - - name: Populate Linux sysroot - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - run: | - bash .github/workflows/populate_linux_sysroot.sh - tar -czvf .sysroot/linux.tar.gz -C .sysroot linux - - name: Save Linux sysroot cache - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: .sysroot/linux.tar.gz - key: ${{ steps.cache-linux-sysroot.outputs.cache-primary-key }} - build: runs-on: ubuntu-latest - needs: [populate-darwin-sysroot, populate-linux-sysroot] + needs: [populate-darwin-sysroot] steps: - name: Check out code uses: actions/checkout@v5 @@ -73,19 +48,13 @@ jobs: uses: actions/cache/restore@v4 with: path: .sysroot/darwin.tar.gz - key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.2 - - name: Restore Linux sysroot cache - id: cache-linux-sysroot - uses: actions/cache/restore@v4 - with: - path: .sysroot/linux.tar.gz - key: linux-sysroot-${{ hashFiles('.github/workflows/populate_linux_sysroot.sh') }}-0.0.2 + key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.3 - name: Extract sysroots run: | - mkdir -p .sysroot - if [ -f .sysroot/darwin.tar.gz ]; then tar -xzvf .sysroot/darwin.tar.gz -C .sysroot; fi - if [ -f .sysroot/linux.tar.gz ]; then tar -xzvf .sysroot/linux.tar.gz -C .sysroot; fi - ls -la .sysroot + tar -xzvf .sysroot/darwin.tar.gz -C .sysroot + - name: Populate Linux sysroot + run: | + bash .github/workflows/populate_linux_sysroot.sh tree .sysroot - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -221,18 +190,11 @@ jobs: uses: actions/cache/restore@v4 with: path: .sysroot/darwin.tar.gz - key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.2 - - name: Restore Linux sysroot cache - id: cache-linux-sysroot - uses: actions/cache/restore@v4 - with: - path: .sysroot/linux.tar.gz - key: linux-sysroot-${{ hashFiles('.github/workflows/populate_linux_sysroot.sh') }}-0.0.2 + key: darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh') }}-0.0.3 - name: Extract sysroots - run: | - mkdir -p .sysroot - if [ -f .sysroot/darwin.tar.gz ]; then tar -xzvf .sysroot/darwin.tar.gz -C .sysroot; fi - if [ -f .sysroot/linux.tar.gz ]; then tar -xzvf .sysroot/linux.tar.gz -C .sysroot; fi + run: tar -xzvf .sysroot/darwin.tar.gz -C .sysroot + - name: Populate Linux sysroot + run: bash .github/workflows/populate_linux_sysroot.sh - name: Run GoReleaser (Release) env: GITHUB_TOKEN: ${{github.token}}