ci(release test):revert to cache linux

This commit is contained in:
luoliwoshang
2025-09-03 20:48:16 +08:00
parent b58cce09ab
commit b8b0ae00d0

View File

@@ -18,7 +18,7 @@ jobs:
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
path: .sysroot/darwin.tar.gz 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 lookup-only: true
- name: Populate Darwin sysroot - name: Populate Darwin sysroot
if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true' if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true'
@@ -31,34 +31,9 @@ jobs:
with: with:
path: .sysroot/darwin.tar.gz path: .sysroot/darwin.tar.gz
key: ${{ steps.cache-darwin-sysroot.outputs.cache-primary-key }} 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: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [populate-darwin-sysroot, populate-linux-sysroot] needs: [populate-darwin-sysroot]
steps: steps:
- name: Check out code - name: Check out code
uses: actions/checkout@v5 uses: actions/checkout@v5
@@ -73,19 +48,13 @@ jobs:
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
path: .sysroot/darwin.tar.gz 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
- 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
- name: Extract sysroots - name: Extract sysroots
run: | run: |
mkdir -p .sysroot tar -xzvf .sysroot/darwin.tar.gz -C .sysroot
if [ -f .sysroot/darwin.tar.gz ]; then tar -xzvf .sysroot/darwin.tar.gz -C .sysroot; fi - name: Populate Linux sysroot
if [ -f .sysroot/linux.tar.gz ]; then tar -xzvf .sysroot/linux.tar.gz -C .sysroot; fi run: |
ls -la .sysroot bash .github/workflows/populate_linux_sysroot.sh
tree .sysroot tree .sysroot
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@@ -221,18 +190,11 @@ jobs:
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
path: .sysroot/darwin.tar.gz 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
- 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
- name: Extract sysroots - name: Extract sysroots
run: | run: tar -xzvf .sysroot/darwin.tar.gz -C .sysroot
mkdir -p .sysroot - name: Populate Linux sysroot
if [ -f .sysroot/darwin.tar.gz ]; then tar -xzvf .sysroot/darwin.tar.gz -C .sysroot; fi run: bash .github/workflows/populate_linux_sysroot.sh
if [ -f .sysroot/linux.tar.gz ]; then tar -xzvf .sysroot/linux.tar.gz -C .sysroot; fi
- name: Run GoReleaser (Release) - name: Run GoReleaser (Release)
env: env:
GITHUB_TOKEN: ${{github.token}} GITHUB_TOKEN: ${{github.token}}