mirror of
https://github.com/TommyFang2077/dsh-desktop.git
synced 2026-08-17 09:06:36 +08:00
- bundle dshmarket 1.10.1; drop the duplicate vision settings section (modlens card is the single config surface) - embed the updater signing public key in every build (Makefile / CI / Flatpak); in-app updates now actually run - structured release notes per version: docs/release-notes/v<version>.md feeds GitHub, Gitea and the in-app update panel - gate releases on the notes file; Gitea publish reads/patches the same body
266 lines
8.6 KiB
YAML
266 lines
8.6 KiB
YAML
name: Release
|
||
|
||
on:
|
||
push:
|
||
tags: ["v*"]
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
concurrency:
|
||
group: release-${{ github.ref }}
|
||
cancel-in-progress: false
|
||
|
||
jobs:
|
||
test:
|
||
name: Test
|
||
runs-on: ubuntu-22.04
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: dtolnay/rust-toolchain@stable
|
||
- uses: swatinem/rust-cache@v2
|
||
with:
|
||
workspaces: ". -> target"
|
||
- uses: actions/setup-python@v5
|
||
with:
|
||
python-version: "3.12"
|
||
- name: Test
|
||
run: make test
|
||
|
||
version:
|
||
name: Version
|
||
runs-on: ubuntu-22.04
|
||
outputs:
|
||
version: ${{ steps.meta.outputs.version }}
|
||
tag: ${{ steps.meta.outputs.tag }}
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- id: meta
|
||
run: |
|
||
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
|
||
test -f "docs/release-notes/v${VERSION}.md" || {
|
||
echo "docs/release-notes/v${VERSION}.md is required for a release (see docs/release-notes/v0.1.1.md)" >&2
|
||
exit 1
|
||
}
|
||
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [ "${GITHUB_REF_NAME}" != "v${VERSION}" ]; then
|
||
echo "Git tag ${GITHUB_REF_NAME} must match Cargo.toml version v${VERSION}" >&2
|
||
exit 1
|
||
fi
|
||
|
||
vendor:
|
||
name: Vendor Flatpak runtime
|
||
needs: test
|
||
runs-on: ubuntu-22.04
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "24"
|
||
- name: Vendor dsh, ModLens, and presets
|
||
run: make vendor
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: vendor
|
||
path: vendor
|
||
include-hidden-files: true
|
||
retention-days: 1
|
||
|
||
package:
|
||
name: Package ${{ matrix.name }}
|
||
needs: [test, version]
|
||
permissions:
|
||
contents: write
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
include:
|
||
- name: macos-arm64
|
||
platform: macos-latest
|
||
rust_targets: aarch64-apple-darwin
|
||
args: --target aarch64-apple-darwin --bundles app,dmg
|
||
- name: macos-x64
|
||
platform: macos-latest
|
||
rust_targets: x86_64-apple-darwin
|
||
args: --target x86_64-apple-darwin --bundles app,dmg
|
||
- name: linux
|
||
platform: ubuntu-22.04
|
||
rust_targets: ""
|
||
args: --bundles deb,rpm,appimage
|
||
- name: windows
|
||
platform: windows-latest
|
||
rust_targets: ""
|
||
args: --bundles nsis,msi
|
||
runs-on: ${{ matrix.platform }}
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "24"
|
||
|
||
- uses: actions/setup-python@v5
|
||
with:
|
||
python-version: "3.12"
|
||
|
||
- uses: dtolnay/rust-toolchain@stable
|
||
with:
|
||
targets: ${{ matrix.rust_targets }}
|
||
|
||
- uses: swatinem/rust-cache@v2
|
||
with:
|
||
workspaces: ". -> target"
|
||
|
||
- name: Install Linux packaging deps
|
||
if: matrix.platform == 'ubuntu-22.04'
|
||
run: |
|
||
sudo apt-get update
|
||
sudo apt-get install -y \
|
||
libwebkit2gtk-4.1-dev \
|
||
libgtk-3-dev \
|
||
librsvg2-dev \
|
||
patchelf \
|
||
xdg-utils \
|
||
rpm
|
||
|
||
- name: Vendor bundled plugins
|
||
shell: bash
|
||
run: bash scripts/vendor-native.sh
|
||
|
||
- name: Export embedded updater public key
|
||
run: echo "DSH_DESKTOP_UPDATER_PUBKEY=$(jq -r '.plugins.updater.pubkey' src-tauri/tauri.conf.json)" >> "$GITHUB_ENV"
|
||
|
||
- uses: tauri-apps/tauri-action@v1
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||
with:
|
||
projectPath: .
|
||
tagName: v__VERSION__
|
||
releaseName: DeepSeek Harness Desktop v__VERSION__
|
||
releaseBody: |
|
||
跨平台安装包:Windows NSIS/MSI、macOS DMG(Apple Silicon 与 Intel)、Linux deb/rpm。
|
||
Flatpak 由同一次 Release 工作流另外上传。
|
||
|
||
- Windows / macOS / deb / rpm 需要本机已安装 `dsh`(`npm i -g @deepseek-ai/dsh`),或设置 `DSH_DESKTOP_DSH_BIN`。
|
||
- Flatpak 自带 Node.js 与 `dsh`。
|
||
- macOS 包未公证,需在「系统设置 → 隐私与安全性」中允许打开。
|
||
- 中国大陆用户可从 Gitea 镜像下载安装包;壳更新使用同一镜像并在安装前校验 Tauri 签名。
|
||
releaseDraft: false
|
||
prerelease: false
|
||
uploadUpdaterJson: false
|
||
uploadUpdaterSignatures: true
|
||
args: ${{ matrix.args }}
|
||
|
||
- name: Collect Gitea release artifacts
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: gitea-${{ matrix.name }}
|
||
path: |
|
||
target/**/release/bundle/**/*.dmg
|
||
target/**/release/bundle/**/*.app.tar.gz
|
||
target/**/release/bundle/**/*.app.tar.gz.sig
|
||
target/**/release/bundle/**/*.deb
|
||
target/**/release/bundle/**/*.rpm
|
||
target/**/release/bundle/**/*.AppImage
|
||
target/**/release/bundle/**/*.AppImage.sig
|
||
target/**/release/bundle/**/*.exe
|
||
target/**/release/bundle/**/*.exe.sig
|
||
target/**/release/bundle/**/*.msi
|
||
target/**/release/bundle/**/*.msi.sig
|
||
if-no-files-found: error
|
||
retention-days: 1
|
||
|
||
flatpak:
|
||
name: Flatpak
|
||
needs: [test, version, vendor]
|
||
runs-on: ubuntu-latest
|
||
container:
|
||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
|
||
options: --privileged
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- uses: actions/download-artifact@v4
|
||
with:
|
||
name: vendor
|
||
path: vendor
|
||
|
||
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||
with:
|
||
bundle: io.github.tommyfang.DshDesktop.flatpak
|
||
manifest-path: flatpak/io.github.tommyfang.DshDesktop.yml
|
||
cache-key: flatpak-gnome-50-${{ hashFiles('flatpak/io.github.tommyfang.DshDesktop.yml', 'Cargo.lock') }}
|
||
upload-artifact: false
|
||
|
||
- name: Attach Flatpak to GitHub Release
|
||
uses: softprops/action-gh-release@v2
|
||
with:
|
||
tag_name: ${{ needs.version.outputs.tag }}
|
||
name: DeepSeek Harness Desktop v${{ needs.version.outputs.version }}
|
||
files: io.github.tommyfang.DshDesktop.flatpak
|
||
fail_on_unmatched_files: true
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
- name: Collect Gitea Flatpak artifact
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: gitea-flatpak
|
||
path: io.github.tommyfang.DshDesktop.flatpak
|
||
if-no-files-found: error
|
||
retention-days: 1
|
||
|
||
release-notes:
|
||
name: Release notes
|
||
needs: [version, package, flatpak]
|
||
runs-on: ubuntu-22.04
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Set structured release body
|
||
uses: softprops/action-gh-release@v2
|
||
with:
|
||
tag_name: ${{ needs.version.outputs.tag }}
|
||
name: DeepSeek Harness Desktop v${{ needs.version.outputs.version }}
|
||
body_path: docs/release-notes/v${{ needs.version.outputs.version }}.md
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
publish-gitea:
|
||
name: Publish Gitea mirror
|
||
needs: [version, package, flatpak]
|
||
runs-on: ubuntu-22.04
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- uses: actions/download-artifact@v4
|
||
with:
|
||
pattern: gitea-*
|
||
path: artifacts
|
||
|
||
- name: Normalize artifacts and build latest.json
|
||
env:
|
||
VERSION: ${{ needs.version.outputs.version }}
|
||
run: |
|
||
python3 scripts/build-gitea-update.py \
|
||
--artifacts artifacts \
|
||
--output staged \
|
||
--version "$VERSION" \
|
||
--pub-date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||
--notes "$(python3 scripts/release-notes.py notes "docs/release-notes/v${VERSION}.md")" \
|
||
--package-base-url "https://git.fangsiyuan.top/api/packages/TomHanck4/generic/dsh-easy-desktop-updater"
|
||
|
||
- name: Publish Gitea release and updater feed
|
||
env:
|
||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||
GITEA_BASE_URL: https://git.fangsiyuan.top
|
||
GITEA_OWNER: TomHanck4
|
||
GITEA_REPO: dsh-easy-desktop
|
||
RELEASE_TAG: ${{ needs.version.outputs.tag }}
|
||
RELEASE_VERSION: ${{ needs.version.outputs.version }}
|
||
run: bash scripts/publish-gitea-release.sh staged
|