Skip to content

Commit 109e4f2

Browse files
committed
src, scripts: use kv to cache directories
Closes #159 Closes #314 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
1 parent 20bcac4 commit 109e4f2

File tree

15 files changed

+1197
-46
lines changed

15 files changed

+1197
-46
lines changed

.env.example

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Your Cloudflare account tag.
2+
#
3+
# Needed for:
4+
# - Directory cache scripts
5+
CLOUDFLARE_ACCOUNT_ID=
6+
7+
# Cloudflare V4 API token.
8+
#
9+
# Needed for:
10+
# - Directory cache scripts
11+
#
12+
# Required permissions:
13+
# - `Workers KV Storage`: Edit
14+
# - `Workers R2 Storage`: Read
15+
#
16+
# See https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
17+
CLOUDFLARE_API_TOKEN=
18+
19+
# S3 credentials for your R2 bucket.
20+
#
21+
# Needed for:
22+
# - Directory listings in the worker.
23+
# - Directory cache scripts
24+
#
25+
# Required permissions:
26+
# - `Object Read Only`
27+
#
28+
# See https://dash.cloudflare.com/?account=/r2/api-tokens
29+
S3_ACCESS_KEY_ID=
30+
S3_ACCESS_KEY_SECRET=

.github/workflows/update-links.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ permissions:
66
on:
77
# Triggered by https://github.com/nodejs/node/blob/main/.github/workflows/update-release-links.yml
88
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Node.js version (ex/ `v20.0.0`)'
12+
required: true
13+
type: string
914
schedule:
1015
- cron: '0 0 * * *'
1116

@@ -81,6 +86,15 @@ jobs:
8186
env:
8287
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
8388

89+
# Do this last for now so we avoid breaking releases if anything breaks
90+
- name: Update Directory Cache
91+
run: node scripts/update-directory-cache.mjs "$VERSION_INPUT"
92+
env:
93+
VERSION_INPUT: '${{ inputs.version }}'
94+
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
95+
S3_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }}
96+
S3_ACCESS_KEY_SECRET: ${{ secrets.CF_SECRET_ACCESS_KEY }}
97+
8498
- name: Alert on Failure
8599
if: failure() && github.repository == 'nodejs/release-cloudflare-worker'
86100
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
dist/
44
.dev.vars
55
.sentryclirc
6+
.env

0 commit comments

Comments
 (0)