Files
KimiCodeSwitch/.github/workflows/release.yml
T
KimiSwitch Dev f643802f82 chore(release): Windows 安装包以 NSIS 为主,MSI 不再主动发布
- CI Windows 构建由 --bundles msi 改为 --bundles nsis
- tauri.conf.json 默认打包目标改为仅 nsis(需要 MSI 可本地 --bundles msi 构建)
- 应用内「检查更新」优先下载 NSIS setup exe,无 exe 的历史版本自动回落 .msi
- 发布说明模板 / README 双语下载说明同步更新,CHANGELOG 记录该分发策略变更
- 测试:Rust 200(资产选择新增 NSIS 优先与 MSI 回落两例)、前端 146
2026-10-15 11:37:05 +08:00

135 lines
4.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
version-check:
name: Version consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Verify tag matches package.json / Cargo.toml / tauri.conf.json
run: |
TAG="${GITHUB_REF_NAME}"
chmod +x scripts/check-version.sh
./scripts/check-version.sh "$TAG"
build:
name: Build (${{ matrix.platform }})
needs: version-check
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
args: --bundles deb,appimage,rpm
- platform: macos-latest
args: --bundles app,dmg
- platform: windows-latest
args: --bundles nsis
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- uses: dtolnay/rust-toolchain@stable
with:
cache: true
- name: Install Linux build dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev
- name: Compose release body
id: notes
shell: bash
run: |
FILE="docs/release-notes/${{ github.ref_name }}.md"
[ -f "$FILE" ] || FILE="docs/release-notes/release-notes-${{ github.ref_name }}.md"
[ -f "$FILE" ] || FILE="release-notes-${{ github.ref_name }}.md"
{
echo 'body<<RELEASE_BODY_EOF'
if [ -f "$FILE" ]; then
cat "$FILE"
else
echo "## ${{ github.ref_name }}"
echo
echo "见提交记录(未找到 $FILE)。"
fi
echo
cat <<'TAIL_EOF'
### Downloads by platform
- **Windows**: `.exe`(NSIS 安装包)——自 v0.8.3 起 Windows 以 NSIS 为主,**MSI 不再主动发布**(历史版本的 `.msi` 仍可下载)
- **macOS**: `.dmg` + `.app`(未签名,仅 Apple Silicon / M 系列芯片)
- **Linux**: `.deb` / `.AppImage` / `.rpm`
### macOS 安装说明(无开发者账号签名,需一次手动绕过)
1. 下载 `Kimi.Switch_*.dmg`,双击挂载后把 `Kimi Switch.app` 拖入「应用程序」文件夹
2. 下载本 Release 附带的 `install-macos.sh`,在终端运行:
```bash
bash install-macos.sh
```
脚本会自动清除「下载隔离」属性并启动应用,之后可正常使用。
3. 手动替代方案:右键 `Kimi Switch.app` → 打开 → 弹窗中点「打开」(或 系统设置 → 隐私与安全性 → 仍要打开)
Full changelog: see commit history.
TAIL_EOF
echo 'RELEASE_BODY_EOF'
} >> "$GITHUB_OUTPUT"
- name: Build and upload release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: ${{ github.ref_name }}
releaseBody: ${{ steps.notes.outputs.body }}
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
overwrite: true
args: ${{ matrix.args }}
upload-macos-script:
name: Attach macOS install script
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upload install-macos.sh to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ github.ref_name }}" scripts/install-macos.sh --clobber