mirror of
https://github.com/HuLaSpark/HuLa.git
synced 2026-09-01 14:52:48 +08:00
e1b1984c53
修复系统托盘事件出错问题 更新依赖 修复类型报错
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
version: '3.7'
|
|
services:
|
|
tauri:
|
|
image: ubuntu:22.04
|
|
volumes:
|
|
- .:/app
|
|
# 只挂载构建产物目录
|
|
- ./src-tauri/target/release:/app/src-tauri/target/release
|
|
environment:
|
|
- RUST_BACKTRACE=1
|
|
- CARGO_HOME=/root/.cargo
|
|
- RUSTUP_HOME=/root/.rustup
|
|
- DEBIAN_FRONTEND=noninteractive
|
|
command:
|
|
- 'bash'
|
|
- '-c'
|
|
- |
|
|
cd /app
|
|
apt-get update
|
|
apt-get install -y curl git build-essential libwebkit2gtk-4.1-dev librsvg2-dev patchelf libudev-dev \
|
|
libasound2-dev pkg-config libgtk-3-dev libayatana-appindicator3-dev
|
|
|
|
# 安装 Node.js 22
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
apt-get install -y nodejs
|
|
npm install -g npm@latest
|
|
|
|
# 安装指定版本的 pnpm
|
|
npm install -g pnpm@9
|
|
pnpm --version
|
|
|
|
# 安装 Rust
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
source "$CARGO_HOME/env"
|
|
|
|
# 配置镜像源
|
|
pnpm config set registry https://repo.huaweicloud.com/repository/npm/
|
|
rustup default stable
|
|
mkdir -p ~/.cargo
|
|
echo '[source.crates-io]
|
|
replace-with = "rsproxy-sparse"
|
|
[source.rsproxy]
|
|
registry = "https://rsproxy.cn/crates.io-index"
|
|
[source.rsproxy-sparse]
|
|
registry = "sparse+https://rsproxy.cn/index/"
|
|
[registries.rsproxy]
|
|
index = "https://rsproxy.cn/crates.io-index"' > ~/.cargo/config.toml
|
|
|
|
# 构建项目
|
|
cd /app
|
|
echo "📦 Installing dependencies..."
|
|
rm -rf node_modules pnpm-lock.yaml
|
|
pnpm install
|
|
|
|
echo "🔨 Building Vite project..."
|
|
pnpm build || exit 1
|
|
|
|
echo "✨ Starting Tauri build..."
|
|
pnpm tauri build || exit 1
|
|
echo "✅ Tauri build completed. Check src-tauri/target/release for the output."
|