Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 68 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,43 @@ jobs:
platform: win-arm64
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '22.13.1'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.1

- name: Install dependencies
run: npm install
run: pnpm install

- name: Configure pnpm workspace for Windows ${{ matrix.arch }}
run: pnpm run install:sharp
env:
TARGET_OS: win32
TARGET_ARCH: ${{ matrix.arch }}

- name: Install dependencies
run: pnpm install
env:
npm_config_build_from_source: true
npm_config_platform: win32
npm_config_arch: ${{ matrix.arch }}

- name: Install Node Runtime
run: npm run installRuntime:win:${{ matrix.arch }}
- name: Install Sharp
run: npm install sharp --build-from-source
run: pnpm run installRuntime:win:${{ matrix.arch }}

- name: Build Windows
run: npm run build:win:${{ matrix.arch }}
run: pnpm run build:win:${{ matrix.arch }}
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -67,25 +85,39 @@ jobs:
platform: linux-x64
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '22.13.1'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.1

- name: Install dependencies
run: npm install
run: pnpm install

- name: Configure pnpm workspace for Linux ${{ matrix.arch }}
run: pnpm run install:sharp
env:
npm_config_platform: linux
npm_config_arch: ${{ matrix.arch }}
TARGET_OS: linux
TARGET_ARCH: ${{ matrix.arch }}

- name: Install dependencies
run: pnpm install

- name: Install Node Runtime
run: npm run installRuntime:linux:${{ matrix.arch }}
- name: Install Sharp
run: npm install --cpu=wasm32 sharp
run: pnpm run installRuntime:linux:${{ matrix.arch }}

- name: Build Linux
run: npm run build:linux:${{ matrix.arch }}
run: pnpm run build:linux:${{ matrix.arch }}
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -107,21 +139,34 @@ jobs:
platform: mac-arm64
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '22.13.1'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.1

- name: Install dependencies
run: npm install
run: pnpm install

- name: Configure pnpm workspace for macOS ${{ matrix.arch }}
run: pnpm run install:sharp
env:
npm_config_platform: darwin
npm_config_arch: ${{ matrix.arch }}
TARGET_OS: darwin
TARGET_ARCH: ${{ matrix.arch }}

- name: Install dependencies
run: pnpm install

- name: Install Node Runtime
run: npm run installRuntime:mac:${{ matrix.arch }}
- name: Install Sharp
run: npm i --cpu=${{ matrix.arch }} --os=darwin sharp
run: pnpm run installRuntime:mac:${{ matrix.arch }}

- name: Build Mac
run: npm run build:mac:${{ matrix.arch }}
run: pnpm run build:mac:${{ matrix.arch }}
env:
CSC_LINK: ${{ secrets.DEEPCHAT_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.DEEPCHAT_CSC_KEY_PASS }}
Expand All @@ -133,6 +178,7 @@ jobs:
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
NODE_OPTIONS: '--max-old-space-size=4096'

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
34 changes: 24 additions & 10 deletions .github/workflows/prcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@ jobs:
- arch: x64
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Check Lint
run: npm run lint
node-version: '22.13.1'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.1

- name: Install dependencies
run: npm install
run: pnpm install

- name: Configure pnpm workspace for Linux ${{ matrix.arch }}
run: pnpm run install:sharp
env:
npm_config_platform: linux
npm_config_arch: ${{ matrix.arch }}
- name: Install Sharp
run: npm install --cpu=wasm32 sharp
TARGET_OS: linux
TARGET_ARCH: ${{ matrix.arch }}

- name: Install dependencies
run: pnpm install

- name: Check Lint
run: pnpm run lint

- name: Check translations
run: npm run i18n && npm run i18n:en
run: pnpm run i18n

- name: Build
run: npm run build
run: pnpm run build
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
- Code submitted to the `dev` branch must ensure:
- Basic functionality works
- No compilation errors
- Project can start normally with `npm run dev`
- Project can start normally with `pnpm run dev`

#### Major Features or Refactoring

Expand Down Expand Up @@ -84,12 +84,13 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
4. Install project dependencies:

```bash
npm install
pnpm install
pnpm run installRuntime
```

5. Start the development server:
```bash
npm run dev
pnpm run dev
```

## Project Structure
Expand All @@ -109,8 +110,9 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
Please ensure your code follows our style guidelines by running:

```bash
npm run build
npm run i18n
pnpm run lint
pnpm run build
pnpm run i18n
```

## Pull Request Process
Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTING.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- 提交到 `dev` 分支的代码必须确保:
- 功能基本正常
- 无编译错误
- 至少能够 `npm run dev` 正常启动
- 至少能够 `pnpm run dev` 正常启动

#### 大型功能新增或重构

Expand Down Expand Up @@ -84,13 +84,13 @@
4. 安装项目依赖:

```bash
npm install
npm run installRuntime
pnpm install
pnpm run installRuntime
```

5. 启动开发服务器:
```bash
npm run dev
pnpm run dev
```

## 项目结构
Expand All @@ -110,8 +110,9 @@ npm run dev
请确保您的代码符合我们的代码风格指南,可以运行以下命令:

```bash
npm run build
npm run i18n
pnpm run lint
pnpm run i18n
pnpm run build
```

## Pull Request 流程
Expand Down
32 changes: 12 additions & 20 deletions README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,45 +259,37 @@ Mac関連の署名とパッケージングについては、[Mac リリースガ
### 依存関係のインストール

```bash
$ npm install
$ npm run installRuntime
$ pnpm install
$ pnpm run installRuntime
# エラーが出た場合: No module named 'distutils'
$ pip install setuptools
# Windows x64の場合
$ npm install --cpu=x64 --os=win32 sharp
# Mac Apple Siliconの場合
$ npm install --cpu=arm64 --os=darwin sharp
# Mac Intelの場合
$ npm install --cpu=x64 --os=darwin sharp
# Linux x64の場合
$ npm install --cpu=x64 --os=linux sharp
```

### 開発を開始

```bash
$ npm run dev
$ pnpm run dev
```

### ビルド

```bash
# Windowsの場合
$ npm run build:win
$ pnpm run build:win

# macOSの場合
$ npm run build:mac
$ pnpm run build:mac

# Linuxの場合
$ npm run build:linux
$ pnpm run build:linux

# アーキテクチャを指定してパッケージング
$ npm run build:win:x64
$ npm run build:win:arm64
$ npm run build:mac:x64
$ npm run build:mac:arm64
$ npm run build:linux:x64
$ npm run build:linux:arm64
$ pnpm run build:win:x64
$ pnpm run build:win:arm64
$ pnpm run build:mac:x64
$ pnpm run build:mac:arm64
$ pnpm run build:linux:x64
$ pnpm run build:linux:arm64
```

## 👥 コミュニティと貢献
Expand Down
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,45 +263,37 @@ For Mac-related signing and packaging, please refer to the [Mac Release Guide](h
### Install Dependencies

```bash
$ npm install
$ npm run installRuntime
$ pnpm install
$ pnpm run installRuntime
# if got err: No module named 'distutils'
$ pip install setuptools
# for windows x64
$ npm install --cpu=x64 --os=win32 sharp
# for mac apple silicon
$ npm install --cpu=arm64 --os=darwin sharp
# for mac intel
$ npm install --cpu=x64 --os=darwin sharp
# for linux x64
$ npm install --cpu=x64 --os=linux sharp
```

### Start Development

```bash
$ npm run dev
$ pnpm run dev
```

### Build

```bash
# For Windows
$ npm run build:win
$ pnpm run build:win

# For macOS
$ npm run build:mac
$ pnpm run build:mac

# For Linux
$ npm run build:linux
$ pnpm run build:linux

# Specify architecture packaging
$ npm run build:win:x64
$ npm run build:win:arm64
$ npm run build:mac:x64
$ npm run build:mac:arm64
$ npm run build:linux:x64
$ npm run build:linux:arm64
$ pnpm run build:win:x64
$ pnpm run build:win:arm64
$ pnpm run build:mac:x64
$ pnpm run build:mac:arm64
$ pnpm run build:linux:x64
$ pnpm run build:linux:arm64
```

For a more detailed guide on development, project structure, and architecture, please see the [Developer Guide](./docs/developer-guide.md).
Expand Down
Loading