mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-11-01 21:03:54 +08:00
fix(ci): 锁定 Node 25.9.0 / pnpm 9.15.0 并升级流水线
This commit is contained in:
42
.github/workflows/CD.yaml
vendored
42
.github/workflows/CD.yaml
vendored
@@ -11,10 +11,12 @@ on:
|
||||
- next
|
||||
workflow_dispatch:
|
||||
|
||||
# # vercel 环境变量
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
# Node / pnpm 版本与 package.json、.nvmrc 保持一致
|
||||
NODE_VERSION: 25.9.0
|
||||
PNPM_VERSION: 9.15.0
|
||||
|
||||
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
|
||||
permissions:
|
||||
@@ -26,7 +28,7 @@ jobs:
|
||||
# 部署到Github-Pages
|
||||
deploy-github:
|
||||
name: 部署到Github-Pages
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
@@ -34,24 +36,23 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||||
fetch-depth: 0
|
||||
|
||||
# 安装PNPM
|
||||
# 安装 PNPM(版本与 package.json packageManager 一致)
|
||||
- name: PNPM Install
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v5
|
||||
with:
|
||||
version: 9.6.0
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
# 安装Node环境
|
||||
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20.16.0
|
||||
# 缓存
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
- name: Install Dependencies
|
||||
@@ -63,42 +64,41 @@ jobs:
|
||||
run: pnpm build:proxy
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: .vuepress/dist
|
||||
|
||||
# 部署
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
uses: actions/deploy-pages@v5
|
||||
|
||||
# 版本发布
|
||||
release:
|
||||
name: Github版本发布
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
# # 主库main、next且执行release更新时执行
|
||||
if: github.repository == '142vip/408CSFamily' && startsWith(github.event.head_commit.message, 'chore(release):')
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||||
fetch-depth: 0
|
||||
|
||||
# 安装PNPM
|
||||
# 安装 PNPM(版本与 package.json packageManager 一致)
|
||||
- name: PNPM Install
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v5
|
||||
with:
|
||||
version: 9.6.0
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
# 安装Node环境
|
||||
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20.16.0
|
||||
# 缓存
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
- name: Install Dependencies
|
||||
|
||||
41
.github/workflows/CI.yml
vendored
41
.github/workflows/CI.yml
vendored
@@ -22,11 +22,14 @@ env:
|
||||
# 阿里云仓库信息
|
||||
REGISTRY: registry.cn-hangzhou.aliyuncs.com
|
||||
UserName: 142vip
|
||||
# Node / pnpm 版本与 package.json、.nvmrc 保持一致
|
||||
NODE_VERSION: 25.9.0
|
||||
PNPM_VERSION: 9.15.0
|
||||
|
||||
jobs:
|
||||
Base-Build:
|
||||
name: 基础编译构建
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
# 主库且拉取PR时触发
|
||||
if: github.repository == '142vip/408CSFamily' && github.event_name == 'pull_request'
|
||||
permissions:
|
||||
@@ -35,27 +38,26 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||||
fetch-depth: 0
|
||||
|
||||
# 安装PNPM
|
||||
# 安装 PNPM(版本与 package.json packageManager 一致)
|
||||
- name: PNPM Install
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v5
|
||||
with:
|
||||
version: 9.6.0
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
# 安装Node环境
|
||||
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20.16.0
|
||||
# # 缓存
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
# 下载依赖,并执行初始化脚本:钩子函数、思维导图构建
|
||||
# 下载依赖,并执行初始化脚本
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
./scripts/ci
|
||||
@@ -74,7 +76,7 @@ jobs:
|
||||
|
||||
Build-Docker-Image:
|
||||
name: 构建Docker镜像
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
# 主库且tag更新时执行
|
||||
if: github.repository == '142vip/408CSFamily' && startsWith(github.event.head_commit.message, 'chore(release):')
|
||||
permissions:
|
||||
@@ -83,7 +85,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
|
||||
@@ -104,21 +106,20 @@ jobs:
|
||||
--password=${{ secrets.DOCKER_PASSWORD }} \
|
||||
${{env.REGISTRY}}
|
||||
|
||||
# 安装PNPM
|
||||
# 安装 PNPM(版本与 package.json packageManager 一致)
|
||||
- name: PNPM Install
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v5
|
||||
with:
|
||||
version: 9.6.0
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
# 安装Node环境
|
||||
# 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20.16.0
|
||||
# # 缓存
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
# 下载依赖,并执行初始化脚本:钩子函数、思维导图构建
|
||||
# 下载依赖,并执行初始化脚本
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
./scripts/ci
|
||||
|
||||
4
.github/workflows/codeql-analysis.yml
vendored
4
.github/workflows/codeql-analysis.yml
vendored
@@ -11,11 +11,11 @@ on:
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# - 参数:
|
||||
# APP_VERSION: 版本
|
||||
#
|
||||
# 注意:vite构建需要支持node14以上,安装node16较为稳妥
|
||||
# 构建阶段使用 infra 基础镜像(含 Node 25 + corepack),pnpm 版本由 package.json 的 packageManager 锁定
|
||||
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/142vip-infra/node:25.9.0-base AS build_base
|
||||
ARG NEED_PROXY
|
||||
|
||||
Reference in New Issue
Block a user