Skip to content

Commit d53adf1

Browse files
committed
fix(ci): 锁定 Node 25.9.0 / pnpm 9.15.0 并升级流水线
1 parent 8fd03f2 commit d53adf1

4 files changed

Lines changed: 35 additions & 32 deletions

File tree

‎.github/workflows/CD.yaml‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
# vercel
1717
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1818
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
19+
# Node / pnpm 版本与 package.json、.nvmrc 保持一致
20+
NODE_VERSION: 25.9.0
21+
PNPM_VERSION: 9.15.0
1922

2023
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
2124
permissions:
@@ -27,32 +30,31 @@ jobs:
2730
# 部署到Github-Pages
2831
deploy-github:
2932
name: 部署到Github-Pages
30-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-24.04
3134
environment:
3235
name: github-pages
3336
url: ${{ steps.deployment.outputs.page_url }}
3437
if: github.repository == '142vip/JavaScriptCollection'
3538

3639
steps:
3740
- name: Checkout Code
38-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
3942
with:
4043
persist-credentials: false
4144
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
4245
fetch-depth: 0
4346

44-
# 安装PNPM
47+
# 安装 PNPM(版本与 package.json packageManager 一致)
4548
- name: PNPM Install
46-
uses: pnpm/action-setup@v4
49+
uses: pnpm/action-setup@v5
4750
with:
48-
version: 9.15.0
51+
version: ${{ env.PNPM_VERSION }}
4952

50-
# 安装Node环境
53+
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
5154
- name: Install Node.js
52-
uses: actions/setup-node@v4
55+
uses: actions/setup-node@v5
5356
with:
54-
node-version: 20.16.0
55-
# 缓存
57+
node-version: ${{ env.NODE_VERSION }}
5658
cache: pnpm
5759

5860
- name: Install Dependencies
@@ -64,42 +66,41 @@ jobs:
6466
run: pnpm build:proxy
6567

6668
- name: Upload artifact
67-
uses: actions/upload-pages-artifact@v3
69+
uses: actions/upload-pages-artifact@v4
6870
with:
6971
path: .vuepress/dist
7072

7173
# 部署
7274
- name: Deploy to GitHub Pages
7375
id: deployment
74-
uses: actions/deploy-pages@v4
76+
uses: actions/deploy-pages@v5
7577

7678
# 版本发布
7779
release:
7880
name: 创建Github发布
79-
runs-on: ubuntu-latest
81+
runs-on: ubuntu-24.04
8082
# 主库next且执行release更新时执行
8183
if: github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):')
8284

8385
steps:
8486
- name: Checkout Code
85-
uses: actions/checkout@v4
87+
uses: actions/checkout@v5
8688
with:
8789
persist-credentials: false
8890
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
8991
fetch-depth: 0
9092

91-
# 安装PNPM
93+
# 安装 PNPM(版本与 package.json packageManager 一致)
9294
- name: PNPM Install
93-
uses: pnpm/action-setup@v4
95+
uses: pnpm/action-setup@v5
9496
with:
95-
version: 9.15.0
97+
version: ${{ env.PNPM_VERSION }}
9698

97-
# 安装Node环境
99+
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
98100
- name: Install Node.js
99-
uses: actions/setup-node@v4
101+
uses: actions/setup-node@v5
100102
with:
101-
node-version: 20.16.0
102-
# 缓存
103+
node-version: ${{ env.NODE_VERSION }}
103104
cache: pnpm
104105

105106
- name: Install Dependencies

‎.github/workflows/CI.yaml‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,38 @@ env:
2525
# 阿里云仓库信息
2626
REGISTRY: registry.cn-hangzhou.aliyuncs.com
2727
UserName: 142vip
28+
# Node / pnpm 版本与 package.json、.nvmrc 保持一致
29+
NODE_VERSION: 25.9.0
30+
PNPM_VERSION: 9.15.0
2831

2932
jobs:
3033
Base-Build:
3134
name: 基础编译构建
32-
runs-on: ubuntu-latest
35+
runs-on: ubuntu-24.04
3336
if: github.repository == '142vip/JavaScriptCollection' && github.event_name == 'pull_request'
3437
permissions:
3538
actions: read
3639
pull-requests: read
3740

3841
steps:
3942
- name: Checkout Code
40-
uses: actions/checkout@v4
43+
uses: actions/checkout@v5
4144
with:
4245
persist-credentials: false
4346
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
4447
fetch-depth: 0
4548

46-
# 安装PNPM
49+
# 安装 PNPM(版本与 package.json packageManager 一致)
4750
- name: PNPM Install
48-
uses: pnpm/action-setup@v4
51+
uses: pnpm/action-setup@v5
4952
with:
50-
version: 9.15.0
53+
version: ${{ env.PNPM_VERSION }}
5154

52-
# 安装Node环境
55+
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
5356
- name: Install Node.js
54-
uses: actions/setup-node@v4
57+
uses: actions/setup-node@v5
5558
with:
56-
node-version: 20.16.0
57-
# 缓存
59+
node-version: ${{ env.NODE_VERSION }}
5860
cache: pnpm
5961

6062
# 下载依赖并执行初始化脚本

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111
jobs:
1212
analyze:
1313
name: Analyze
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

2020
# Initializes the CodeQL tools for scanning.
2121
- name: Initialize CodeQL

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ENV NODE_OPTIONS="--max-old-space-size=200000"
1616
ENV PNPM_HOME="/pnpm"
1717
ENV PATH="$PNPM_HOME:$PATH"
1818

19-
## corepack 环境变量,在CI脚本中直接设置
19+
# 构建阶段使用 infra 基础镜像(含 Node 25 + corepack),pnpm 版本由 package.json 的 packageManager 锁定
2020
#ENV COREPACK_NPM_REGISTRY=https://mirrors.tencent.com/npm/
2121

2222
WORKDIR /apps

0 commit comments

Comments
 (0)