Skip to content

Commit 7b981d0

Browse files
committed
fix(ci): use webui CID as cache key
1 parent 8429946 commit 7b981d0

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

Diff for: .github/workflows/ci.yml

+24-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@ jobs:
1919
with:
2020
node-version: 'lts/*'
2121

22+
- name: Read ipfs-webui CID from package.json
23+
id: read-webui-version
24+
run: |
25+
echo '::echo::on'
26+
echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
27+
echo '::echo::off'
28+
shell: bash
2229
- name: Cache webui
23-
uses: actions/cache@v2
30+
uses: actions/cache@v3
2431
id: webui-cache
2532
with:
2633
path: assets/webui
27-
key: ${{ hashFiles('package.json') }} # webui CID is defined in this file
34+
key: ${{ steps.read-webui-version.outputs.cid }}
2835

2936
- name: Cache bigger downloads
30-
uses: actions/cache@v2
37+
uses: actions/cache@v3
3138
id: cache
3239
if: steps.webui-cache.outputs.cache-hit != 'true'
3340
with:
@@ -75,15 +82,19 @@ jobs:
7582
with:
7683
node-version: 'lts/*'
7784

85+
- name: Read ipfs-webui CID from package.json
86+
id: read-webui-version
87+
run: echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
88+
shell: bash
7889
- name: Cache webui
79-
uses: actions/cache@v2
90+
uses: actions/cache@v3
8091
id: webui-cache
8192
with:
8293
path: assets/webui
83-
key: ${{ hashFiles('package.json') }}
94+
key: ${{ steps.read-webui-version.outputs.cid }}
8495

8596
- name: Cache bigger downloads
86-
uses: actions/cache@v2
97+
uses: actions/cache@v3
8798
id: cache
8899
with:
89100
path: ${{ github.workspace }}/.cache
@@ -138,15 +149,19 @@ jobs:
138149
with:
139150
node-version: 'lts/*'
140151

152+
- name: Read ipfs-webui CID from package.json
153+
id: read-webui-version
154+
run: echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
155+
shell: bash
141156
- name: Cache webui
142-
uses: actions/cache@v2
157+
uses: actions/cache@v3
143158
id: webui-cache
144159
with:
145160
path: assets/webui
146-
key: ${{ hashFiles('package.json') }}
161+
key: ${{ steps.read-webui-version.outputs.cid }}
147162

148163
- name: Cache bigger downloads
149-
uses: actions/cache@v2
164+
uses: actions/cache@v3
150165
id: cache
151166
with:
152167
path: ${{ github.workspace }}/.cache

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"force-webui-download": "shx rm -rf assets/webui && run-s build:webui",
1818
"build": "run-s clean build:webui",
1919
"build:webui": "run-s build:webui:*",
20-
"build:webui:download": "npx ipfs-or-gateway -c bafybeibozpulxtpv5nhfa2ue3dcjx23ndh3gwr5vwllk7ptoyfwnfjjr4q -p assets/webui/ -t 360000 --verbose",
20+
"build:webui:download": "npx ipfs-or-gateway -c bafybeibozpulxtpv5nhfa2ue3dcjx23ndh3gwr5vwllk7ptoyfwnfjjr4q -p assets/webui/ -t 360000 --verbose -g \"https://dweb.link\" ",
2121
"build:webui:minimize": "shx rm -rf assets/webui/static/js/*.map && shx rm -rf assets/webui/static/css/*.map",
2222
"package": "shx rm -rf dist/ && run-s build && electron-builder --publish onTag"
2323
},

0 commit comments

Comments
 (0)