From 0d86cc808c0d52e776dfcbd8ef70ccf62dd8e9c6 Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Mon, 1 Jul 2024 14:03:50 -0300 Subject: [PATCH] Update Node and Deno versions in workflow files --- .github/workflows/generate-readme.yml | 21 ++++++++++++++++----- .github/workflows/weekly-updates.yml | 11 +++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/generate-readme.yml b/.github/workflows/generate-readme.yml index ca44ce6be..d0ee410dd 100644 --- a/.github/workflows/generate-readme.yml +++ b/.github/workflows/generate-readme.yml @@ -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: | @@ -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 diff --git a/.github/workflows/weekly-updates.yml b/.github/workflows/weekly-updates.yml index 028071a0b..36b58b310 100644 --- a/.github/workflows/weekly-updates.yml +++ b/.github/workflows/weekly-updates.yml @@ -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=( @@ -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