Files
WeChatDataAnalysis/.github/workflows/release.yml
2977094657 a14f8de6d0 feat(app-shell): 桌面端集成自动更新(electron-updater)
- 集成 electron-updater:检查更新/下载/安装/忽略此版本,并推送下载进度到前端

- 打包版启动后自动检查更新;托盘菜单支持手动检查

- preload 暴露 updater IPC + __brand 标记;前端新增更新弹窗与设置页版本/检查更新入口

- 补全发布配置:artifactName/publish;release workflow 增加上传 latest.yml
2026-02-18 16:53:50 +08:00

79 lines
2.1 KiB
YAML

name: Release (Windows)
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-windows-installer:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Derive version from tag
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
if ([string]::IsNullOrWhiteSpace($version)) {
throw "Invalid tag: '$tag' (expected like v1.0.0)"
}
"TAG_NAME=$tag" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: |
frontend/package-lock.json
desktop/package-lock.json
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install uv
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install uv
- name: Install frontend deps
working-directory: frontend
run: npm ci
- name: Install desktop deps
working-directory: desktop
run: npm ci
- name: Set desktop app version (electron-builder)
working-directory: desktop
shell: pwsh
run: |
npm version $env:VERSION --no-git-tag-version --allow-same-version
- name: Build Windows installer
working-directory: desktop
run: npm run dist
- name: Create GitHub Release and upload installer
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true
files: |
desktop/dist/*Setup*.exe
desktop/dist/*Setup*.exe.blockmap
desktop/dist/latest.yml