From 85c1cc3f101d396a7c7e49ace0dbb50a0b797166 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= <yangpanteng@gmail.com>
Date: Wed, 16 Aug 2023 19:03:04 +0800
Subject: [PATCH 1/5] ci: define Node version using environment variables

---
 .github/workflows/canary.yml |  7 +++++--
 .github/workflows/ci.yml     | 23 +++++++++++++----------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml
index cabd601a8ef..9524b0e15d3 100644
--- a/.github/workflows/canary.yml
+++ b/.github/workflows/canary.yml
@@ -5,6 +5,9 @@ on:
     - cron: 0 1 * * MON
   workflow_dispatch:
 
+env:
+  NODE_VERSION: 18
+
 jobs:
   canary:
     # prevents this action from running on forks
@@ -17,10 +20,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           registry-url: 'https://registry.npmjs.org'
           cache: 'pnpm'
 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 232c69b3b75..fa9deb79dbd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,6 +10,9 @@ on:
 permissions:
   contents: read # to fetch code (actions/checkout)
 
+env:
+  NODE_VERSION: 18
+
 jobs:
   unit-test:
     runs-on: ubuntu-latest
@@ -20,10 +23,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
@@ -43,10 +46,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
@@ -75,10 +78,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           cache: 'pnpm'
 
       - run: pnpm install
@@ -95,10 +98,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
@@ -126,10 +129,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to 18
+      - name: Set node version to ${{ env.NODE_VERSION }}
         uses: actions/setup-node@v3
         with:
-          node-version: 18
+          node-version: ${{ env.NODE_VERSION }}
           cache: 'pnpm'
 
       - run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install

From 5d28f486ec513faf82fcd9c33910366c55dac606 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= <yangpanteng@gmail.com>
Date: Mon, 21 Aug 2023 18:55:20 +0800
Subject: [PATCH 2/5] ci: update `NODE_VERSION` to `lts/*`

---
 .github/workflows/canary.yml |  4 ++--
 .github/workflows/ci.yml     | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml
index 9524b0e15d3..01b49082730 100644
--- a/.github/workflows/canary.yml
+++ b/.github/workflows/canary.yml
@@ -6,7 +6,7 @@ on:
   workflow_dispatch:
 
 env:
-  NODE_VERSION: 18
+  NODE_VERSION: lts/* # use the latest LTS release
 
 jobs:
   canary:
@@ -20,7 +20,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fa9deb79dbd..3a1605c229d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,7 +11,7 @@ permissions:
   contents: read # to fetch code (actions/checkout)
 
 env:
-  NODE_VERSION: 18
+  NODE_VERSION: lts/* # use the latest LTS release
 
 jobs:
   unit-test:
@@ -23,7 +23,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -46,7 +46,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -78,7 +78,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -98,7 +98,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -129,7 +129,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to ${{ env.NODE_VERSION }}
+      - name: Set node version to the latest LTS release
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}

From 6d684062468777559fc34b7ad9b7b705f6941c6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= <yangpanteng@gmail.com>
Date: Mon, 21 Aug 2023 20:08:06 +0800
Subject: [PATCH 3/5] chore: update step name

---
 .github/workflows/canary.yml | 2 +-
 .github/workflows/ci.yml     | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml
index 01b49082730..76d50b3d752 100644
--- a/.github/workflows/canary.yml
+++ b/.github/workflows/canary.yml
@@ -20,7 +20,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to the latest LTS release
+      - name: Set node version to LTS
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c66784cd5e7..1665f11d884 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,7 +23,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to the latest LTS release
+      - name: Set node version to LTS
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -46,7 +46,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to the latest LTS release
+      - name: Set node version to LTS
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -78,7 +78,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to the latest LTS release
+      - name: Set node version to LTS
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}
@@ -98,7 +98,7 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to the latest LTS release
+      - name: Set node version to LTS
         uses: actions/setup-node@v3
         with:
           node-version: ${{ env.NODE_VERSION }}

From bec6982ce530dd7ca6fffb5ac8550c5425a9562b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= <yangpanteng@gmail.com>
Date: Thu, 21 Sep 2023 19:10:56 +0800
Subject: [PATCH 4/5] ci: use `.node-version` to maintain node version

---
 .github/workflows/canary.yml      |  7 ++-----
 .github/workflows/ci.yml          | 19 ++++++++-----------
 .github/workflows/size-data.yml   |  4 ++--
 .github/workflows/size-report.yml |  4 ++--
 .node-version                     |  1 +
 5 files changed, 15 insertions(+), 20 deletions(-)
 create mode 100644 .node-version

diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml
index 76d50b3d752..03c460f4d27 100644
--- a/.github/workflows/canary.yml
+++ b/.github/workflows/canary.yml
@@ -5,9 +5,6 @@ on:
     - cron: 0 1 * * MON
   workflow_dispatch:
 
-env:
-  NODE_VERSION: lts/* # use the latest LTS release
-
 jobs:
   canary:
     # prevents this action from running on forks
@@ -20,10 +17,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version-file: '.node-version'
           registry-url: 'https://registry.npmjs.org'
           cache: 'pnpm'
 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1665f11d884..c4d1d49683b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,9 +10,6 @@ on:
 permissions:
   contents: read # to fetch code (actions/checkout)
 
-env:
-  NODE_VERSION: lts/* # use the latest LTS release
-
 jobs:
   unit-test:
     runs-on: ubuntu-latest
@@ -23,10 +20,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version-file: '.node-version'
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
@@ -46,10 +43,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version-file: '.node-version'
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
@@ -78,10 +75,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version-file: '.node-version'
           cache: 'pnpm'
 
       - run: pnpm install
@@ -98,10 +95,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version-file: '.node-version'
           cache: 'pnpm'
 
       - name: Skip Puppeteer download
diff --git a/.github/workflows/size-data.yml b/.github/workflows/size-data.yml
index 647e029c578..44abeb2a087 100644
--- a/.github/workflows/size-data.yml
+++ b/.github/workflows/size-data.yml
@@ -21,10 +21,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: lts/*
+          node-version-file: '.node-version'
           cache: pnpm
 
       - name: Install dependencies
diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml
index 75c52f717b3..3148327bf8b 100644
--- a/.github/workflows/size-report.yml
+++ b/.github/workflows/size-report.yml
@@ -23,10 +23,10 @@ jobs:
       - name: Install pnpm
         uses: pnpm/action-setup@v2
 
-      - name: Set node version to LTS
+      - name: Install Node.js
         uses: actions/setup-node@v3
         with:
-          node-version: lts/*
+          node-version-file: '.node-version'
           cache: pnpm
 
       - name: Install dependencies
diff --git a/.node-version b/.node-version
new file mode 100644
index 00000000000..3c032078a4a
--- /dev/null
+++ b/.node-version
@@ -0,0 +1 @@
+18

From c24462a1155fbf05cff2e84e937fe324fe0b34a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= <yangpanteng@gmail.com>
Date: Fri, 20 Oct 2023 15:10:24 +0800
Subject: [PATCH 5/5] chore: update node version

---
 .node-version | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.node-version b/.node-version
index 3c032078a4a..209e3ef4b62 100644
--- a/.node-version
+++ b/.node-version
@@ -1 +1 @@
-18
+20