mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-10-24 01:58:23 +08:00
根据 Tauri 官方文档,Linux ARM64 需要使用 pguyot/arm-runner-action 模拟器来构建,而不是原生 ARM64 runner。 - 将 Linux ARM64 从 matrix 中移除 - 添加单独的 build-linux-arm64 job - 使用 DietPi RPi5 ARM64 镜像作为基础 - 使用 softprops/action-gh-release 上传构建产物 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
185 lines
5.5 KiB
YAML
185 lines
5.5 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to release (e.g., v0.1.0)'
|
|
required: true
|
|
default: 'v0.1.0'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: macos-latest
|
|
target: aarch64-apple-darwin
|
|
name: macOS-arm64
|
|
- platform: macos-latest
|
|
target: x86_64-apple-darwin
|
|
name: macOS-x64
|
|
- platform: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
name: Windows-x64
|
|
- platform: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
name: Linux-x64
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install Linux dependencies
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Setup Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
shared-key: "rust-cache-${{ matrix.target }}"
|
|
cache-on-failure: true
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Tauri app
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tagName: ${{ github.event.inputs.version || github.ref_name }}
|
|
releaseName: 'ProxyCast ${{ github.event.inputs.version || github.ref_name }}'
|
|
releaseBody: |
|
|
## ProxyCast Release
|
|
|
|
### Features
|
|
- AI API 代理服务
|
|
- Kiro OAuth 凭证管理
|
|
- OpenAI/Anthropic 兼容 API
|
|
- 自动检测凭证文件变化
|
|
- 多 Provider 支持
|
|
|
|
### Downloads
|
|
- **macOS (Apple Silicon)**: `proxycast_*_aarch64.dmg`
|
|
- **macOS (Intel)**: `proxycast_*_x64.dmg`
|
|
- **Windows (64-bit)**: `proxycast_*_x64-setup.exe`
|
|
- **Linux x64**: `proxycast_*_amd64.deb` / `proxycast_*_amd64.AppImage`
|
|
- **Linux ARM64**: `proxycast_*_arm64.deb` / `proxycast_*_arm64.AppImage`
|
|
|
|
### macOS 首次安装
|
|
|
|
由于应用未经 Apple 签名,首次打开可能提示「应用已损坏」,请运行:
|
|
```bash
|
|
xattr -cr /Applications/proxycast.app
|
|
```
|
|
|
|
### 默认配置
|
|
- **端口**: 8999
|
|
- **API Key**: 首次启动自动生成,可在设置页查看/修改
|
|
releaseDraft: false
|
|
prerelease: false
|
|
args: --target ${{ matrix.target }}
|
|
|
|
# Linux ARM64 使用模拟 ARM runner 构建
|
|
build-linux-arm64:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache rust build artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: src-tauri
|
|
cache-on-failure: true
|
|
|
|
- name: Build app in ARM64 emulator
|
|
uses: pguyot/arm-runner-action@v2.6.5
|
|
with:
|
|
base_image: https://dietpi.com/downloads/images/DietPi_RPi5-ARMv8-Bookworm.img.xz
|
|
cpu: cortex-a72
|
|
bind_mount_repository: true
|
|
image_additional_mb: 10240
|
|
optimize_image: no
|
|
commands: |
|
|
# Prevent Rust from complaining about $HOME not matching eid home
|
|
export HOME=/root
|
|
|
|
# Workaround to CI worker being stuck on Updating crates.io index
|
|
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
|
|
|
# Install setup prerequisites
|
|
apt-get update -y --allow-releaseinfo-change
|
|
apt-get autoremove -y
|
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
|
curl \
|
|
libwebkit2gtk-4.1-dev \
|
|
build-essential \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
libfuse2 \
|
|
file
|
|
|
|
# Install Rust
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
. "$HOME/.cargo/env"
|
|
|
|
# Install Node.js
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash
|
|
apt-get install -y nodejs
|
|
|
|
# Install frontend dependencies
|
|
npm ci
|
|
|
|
# Build the application
|
|
npm run tauri build -- --verbose
|
|
|
|
- name: Get app version
|
|
run: echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV
|
|
|
|
- name: Upload deb bundle to release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version || github.ref_name }}
|
|
files: |
|
|
src-tauri/target/release/bundle/deb/*.deb
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload AppImage bundle to release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version || github.ref_name }}
|
|
files: |
|
|
src-tauri/target/release/bundle/appimage/*.AppImage
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|