Skip to content
Open
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
119 changes: 119 additions & 0 deletions .github/workflows/build-desktop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: 构建 Tauri 桌面版本
on:
- push
- workflow_dispatch

permissions:
contents: write

jobs:
clean-pre-release:
name: 删除预发布版本的构建产物
runs-on: ubuntu-latest
steps:
- name: 删除预发布版本的构建产物
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
assets: |
*.*
tag: ${{ github.ref_name }}-dev
fail-if-no-assets: false
fail-if-no-release: false
build-tauri-desktop:
name: 构建 Tauri 桌面版本
needs: clean-pre-release
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
args: ""
name: linux
arch: x86_64
- platform: windows-latest
args: ""
name: windows
arch: x86_64
- platform: macos-latest # arm64 二进制包
args: "--target aarch64-apple-darwin"
name: macOS
arch: aarch64
- platform: macos-latest # x86 二进制包
args: "--target x86_64-apple-darwin"
name: macOS
arch: x86_64
- platform: macos-latest # 通用二进制包
args: "--target universal-apple-darwin"
name: macOS
arch: universal

runs-on: ${{ matrix.platform }}
steps:
- name: 克隆仓库
uses: actions/checkout@v6

- name: 缓存 Rust 依赖
uses: Swatinem/rust-cache@v2
with:
workspaces: ./src-tauri -> target

- name: 安装 PNPM
uses: pnpm/action-setup@v4

- name: 安装 Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm

- name: 安装 Rust 工具链
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

# - name: 安装 wasm32 目标
# run: rustup target add wasm32-unknown-unknown

# macOS 自带的 Xcode LLVM 不支持 WASM 目标
- name: "macOS: 安装 LLVM 和 Clang"
uses: KyleMayes/install-llvm-action@v2
if: matrix.platform == 'macos-latest'
with:
version: "15"

- name: 安装 Tauri 所需系统依赖(仅 Linux)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libappindicator3-dev libwebkit2gtk-4.1-dev librsvg2-dev patchelf

- name: 安装前端依赖
run: pnpm i

- name: 构建 AMLL Editor 程序并发布自动构建
uses: tauri-apps/tauri-action@v0
with:
tagName: ${{ github.ref_name }}-dev
includeUpdaterJson: true
releaseName: AMLL Editor ${{ github.ref_name }} branch development build
releaseBody: |
Latest ${{ github.ref_name }} branch development build.
最新 ${{ github.ref_name }} 分支开发调试构建。
Development version may be unstable and may not work properly, please only for test purpose.
开发版本可能不稳定且可能无法正常工作,请仅用于测试目的。

Latest commits (最新提交): ${{ github.event.head_commit.message }}
prerelease: true
args: ${{ matrix.args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 上传产物到 Action Artifact
uses: actions/upload-artifact@v6
with:
name: AMLL Editor ${{matrix.name}}-${{matrix.arch}}
path: |
src-tauri/target/**/release/bundle/**/*
src-tauri/target/**/release/amll-editor.exe
src-tauri/target/**/release/amll-editor
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"devDependencies": {
"@iconify/json": "^2.2.427",
"@iconify/utils": "^3.1.0",
"@tauri-apps/cli": "^2.9.6",
"@trivago/prettier-plugin-sort-imports": "^6.0.1",
"@tsconfig/node22": "^22.0.5",
"@types/lodash-es": "^4.17.12",
Expand Down Expand Up @@ -93,5 +94,6 @@
"patchedDependencies": {
"@types/wicg-file-system-access": "patches/@types__wicg-file-system-access.patch"
}
}
},
"packageManager": "pnpm@10.28.0"
}
121 changes: 121 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
Loading