@@ -40,39 +40,23 @@ jobs:
4040          aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }} 
4141          aws-region : ${{ secrets.AWS_REGION }} 
4242
43- #       - name: Retrieve JS build artifacts
44- #         uses: strophy/actions-cache@opendal-update
45- #         id: cache
46- #         with:
47- #           bucket: multi-runner-cache-x1xibo9c
48- #           root: actions-cache
49- #           path: build-js-artifacts-${{ github.sha }}.tar
50- #           key: build-js-artifacts/${{ github.sha }}
51- 
52-       - name : Retrieve JS build artifacts 
53-         uses : actions/cache/restore@v4 
54-         id : cache 
43+       - uses : softwareforgood/check-artifact-v4-existence@v0 
44+         id : check-artifact 
5545        with :
56-           path : build-js-artifacts-${{ github.sha }}.tar 
57-           key : build-js-artifacts-${{ github.sha }} 
58-           fail-on-cache-miss : ' true' 
59- 
60-       - name : Unpack JS build artifacts archive 
61-         run : tar -xf build-js-artifacts-${{ github.sha }}.tar 
62-         if : ${{ steps.cache.outputs.cache-hit == 'true' }} 
46+           name : build-js-artifacts-${{ github.sha }} 
6347
6448      - name : Login to DockerHub 
6549        uses : docker/login-action@v3 
66-         if : ${{ steps.cache.outputs.cache-hit != 'true' }} 
6750        with :
6851          username : ${{ secrets.DOCKERHUB_USERNAME }} 
6952          password : ${{ secrets.DOCKERHUB_TOKEN }} 
53+         if : ${{ steps.check-artifact.outputs.exists != 'true' }} 
7054
7155      - name : Setup Rust 
7256        uses : ./.github/actions/rust 
7357        with :
7458          target : wasm32-unknown-unknown 
75-         if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
59+         if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
7660
7761      - name : Setup Node.JS 
7862        uses : ./.github/actions/nodejs 
@@ -83,14 +67,15 @@ jobs:
8367          script : | 
8468            core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); 
8569            core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); 
70+ if : ${{ steps.check-artifact.outputs.exists != 'true' }} 
8671
8772      - name : Install Cargo binstall 
8873        uses : 
cargo-bins/[email protected]   89-         if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
74+         if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
9075
9176      - name : Install wasm-bindgen-cli 
9277        run : 
cargo binstall [email protected]   93-         if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
78+         if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
9479
9580      - name : Build packages 
9681        run : yarn build 
10186#           SCCACHE_BUCKET: multi-runner-cache-x1xibo9c
10287#           SCCACHE_REGION: ${{ secrets.AWS_REGION }}
10388#           SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/wasm/wasm32
104-         if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
89+         if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
10590
10691      - name : Set suffix 
10792        uses : actions/github-script@v6 
@@ -149,16 +134,25 @@ jobs:
149134          echo ".idea" >> .gitignore 
150135          echo ".ultra.cache.json" >> .gitignore 
151136          echo "db/*" >> .gitignore 
152- if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
137+ if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
153138
154139      - name : Get modified files 
155140        id : diff 
156141        run : git ls-files --others --exclude-standard >> artifacts_list.txt 
157-         if : ${{ steps.cache .outputs.cache-hit  != 'true' }} 
142+         if : ${{ steps.check-artifact .outputs.exists  != 'true' }} 
158143
159144      - name : Create an archive of built files 
160145        run : xargs -a artifacts_list.txt tar cvf build-js-artifacts-${{ github.sha }}.tar 
161-         if : ${{ steps.cache.outputs.cache-hit != 'true' }} 
146+         if : ${{ steps.check-artifact.outputs.exists != 'true' }} 
147+ 
148+       - name : Upload the archive of built files 
149+         uses : actions/upload-artifact@v4 
150+         with :
151+           name : build-js-artifacts-${{ github.sha }} 
152+           path : build-js-artifacts-${{ github.sha }}.tar 
153+           retention-days : 1 
154+           if-no-files-found : error 
155+         if : ${{ steps.check-artifact.outputs.exists != 'true' }} 
162156
163157  release-drive-image :
164158    name : Release Drive image 
@@ -252,21 +246,10 @@ jobs:
252246          aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }} 
253247          aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }} 
254248
255- #       - name: Retrieve JS build artifacts
256- #         uses: strophy/actions-cache@opendal-update
257- #         with:
258- #           bucket: multi-runner-cache-x1xibo9c
259- #           root: actions-cache
260- #           path: build-js-artifacts-${{ github.sha }}.tar
261- #           key: build-js-artifacts/${{ github.sha }}
262- 
263-       - name : Retrieve JS build artifacts 
264-         uses : actions/cache/restore@v4 
249+       - name : Download JS build artifacts 
250+         uses : actions/download-artifact@v4 
265251        with :
266-           path : build-js-artifacts-${{ github.sha }}.tar 
267-           key : build-js-artifacts-${{ github.sha }} 
268-           fail-on-cache-miss : ' true' 
269- 
252+           name : build-js-artifacts-${{ github.sha }} 
270253
271254      - name : Unpack JS build artifacts archive 
272255        run : tar -xf build-js-artifacts-${{ github.sha }}.tar 
0 commit comments