mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
chore(workflow): 迁移构建流程至 pnpm
- 在 GitHub Actions 中安装 pnpm 并指定版本为 8 - 将 Node.js 缓存策略从 npm 更改为 pnpm - 使用 pnpm 替代 npm 安装依赖和执行构建命令 - 更新 Electron 构建脚本参数传递方式以适配 pnpm - 移除冗余的 npm 配置并统一使用 pnpm 管理前端依赖
This commit is contained in:
25
.github/workflows/build.yml
vendored
25
.github/workflows/build.yml
vendored
@@ -26,11 +26,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# 安装 pnpm
|
||||||
|
- uses: pnpm/action-setup@v3
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'npm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
@@ -39,10 +44,10 @@ jobs:
|
|||||||
|
|
||||||
# 构建服务端前先构建前端
|
# 构建服务端前先构建前端
|
||||||
- name: Install Frontend Dependencies
|
- name: Install Frontend Dependencies
|
||||||
run: npm install
|
run: pnpm install
|
||||||
|
|
||||||
- name: Build Frontend (for Go Embed)
|
- name: Build Frontend (for Go Embed)
|
||||||
run: npm run build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Compile Go Server
|
- name: Compile Go Server
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -75,20 +80,26 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# 安装 pnpm
|
||||||
|
- uses: pnpm/action-setup@v3
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'npm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: pnpm install
|
||||||
|
|
||||||
- name: Build Frontend (for Electron)
|
- name: Build Frontend (for Electron)
|
||||||
run: npm run build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Build Electron App
|
- name: Build Electron App
|
||||||
run: npm run build:electron -- --${{ matrix.platform }}
|
# 注意: pnpm 传参不需要额外的 --
|
||||||
|
run: pnpm run build:electron --${{ matrix.platform }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user