Skip to content

Commit

Permalink
Update Node and Deno versions in workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Jul 1, 2024
1 parent 4b26bab commit 0d86cc8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/generate-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Deno
uses: denolib/setup-deno@v2
uses: denolib/setup-deno@v2.3.0
with:
deno-version: v1.30
deno-version: v1.44

- name: Download indexes
run: |
Expand All @@ -57,8 +57,19 @@ jobs:
# Get the list of examples previously downloaded
EXAMPLES=$(ls examples-*.json)
# Remove previous examples.json
rm -f examples.json
# Generate the JSON file
./tools/readme-generator/main.ts --json $EXAMPLES > examples.json
./tools/readme-generator/main.ts --json $(echo $EXAMPLES) > examples-list.json
# Transform the JSON file from the format [{...}, {...}] to
# {
# "$schema": "https://raw.githubusercontent.com/nanlabs/awesome-nan/main/examples.schema.json",
# "list": [{...}, {...}]
# }
# and pretty print it
echo "{ \"\$schema\": \"https://raw.githubusercontent.com/nanlabs/awesome-nan/main/examples.schema.json\", \"list\": $(cat examples-list.json) }" | jq . > examples.json
# Generate the README
./tools/readme-generator/main.ts README.md.tmpl examples.json
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/weekly-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Deno
uses: denolib/setup-deno@v2
with:
deno-version: v1.30
deno-version: v1.44

# TODO: Update this job to use the examples.json file from the main branch
# and the examples.json file from the previous week without
# fetching the files from other repositories.
- name: Download indexes from last week
run: |
REPOS=(
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
EXAMPLES=$(ls examples-*.json)
# Generate the JSON file
./tools/readme-generator/main.ts --json examples.json $EXAMPLES > previous-week-examples.json
./tools/readme-generator/main.ts --json $(echo $EXAMPLES) > previous-week-examples.json
# Remove the downloaded files
rm examples-*.json
Expand Down

0 comments on commit 0d86cc8

Please sign in to comment.