Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a8c10af
feat: 置空热键功能
IvanHanloth Jul 16, 2026
fd19c47
Merge pull request #133 from IvanHanloth/feat/allow-unset
IvanHanloth Jul 16, 2026
d549d69
faet: 新增i18n支持
IvanHanloth Jul 19, 2026
4e195fd
doc: 新增繁中、英文文档
IvanHanloth Jul 19, 2026
6777deb
Merge pull request #135 from IvanHanloth/feat/i18n
IvanHanloth Jul 19, 2026
fe04b21
feat: 新增热键不传递功能
IvanHanloth Jul 22, 2026
8f69e24
ci: 优化发版工作流
IvanHanloth Jul 22, 2026
24ad9b7
test: 解决test报错
IvanHanloth Jul 22, 2026
7d43693
Merge pull request #137 from IvanHanloth/feat/intercept-key
IvanHanloth Jul 22, 2026
6bd85d3
doc: 更新部分文字
IvanHanloth Jul 22, 2026
ed8dcc5
feat:新增markdown解析
IvanHanloth Jul 23, 2026
b87fb53
feat: 允许mailto协议,改用verhub SDK对接版本相关服务
IvanHanloth Jul 24, 2026
9c23863
feat: 新增独立隐藏、独立恢复、仅隐藏当前窗口热键
IvanHanloth Jul 25, 2026
45ba7b8
Merge pull request #144 from IvanHanloth/feat/saperate-hide
IvanHanloth Jul 25, 2026
bb4f495
feat: 托盘图标新增状态显示,右键托盘菜单新增切换自动隐藏
IvanHanloth Jul 26, 2026
09d3959
Merge pull request #145 from IvanHanloth/feat/icon-status
IvanHanloth Jul 26, 2026
a2826ce
feat: 更新verhub sdk版本,优化缓存
IvanHanloth Jul 26, 2026
12976d9
feat: 优化记录存储、日志输出,独立副作用工作循环
IvanHanloth Jul 26, 2026
25327df
feat: 优化IPC通信稳定性,优化窗口消息循环,恢复工具与核心状态对齐
IvanHanloth Jul 26, 2026
0a37aa2
feat: 优化窗口智能追踪功能
IvanHanloth Jul 26, 2026
534a9d2
Merge pull request #150 from IvanHanloth/feat/performance-improve
IvanHanloth Jul 26, 2026
4a53b87
Merge branch 'dev' into feat/window-track
IvanHanloth Jul 26, 2026
ecfc1bb
Merge pull request #151 from IvanHanloth/feat/window-track
IvanHanloth Jul 26, 2026
d33282a
fix: 修复已隐藏的窗口会被显示的问题
IvanHanloth Jul 26, 2026
f5d15e4
Merge branch 'dev' into feat/keep-hide
IvanHanloth Jul 26, 2026
6f57353
Merge pull request #152 from IvanHanloth/feat/keep-hide
IvanHanloth Jul 26, 2026
2705964
chore: release自动添加安全提示
IvanHanloth Jul 26, 2026
9e86f96
chore: 优化文案描述
IvanHanloth Jul 26, 2026
aa29895
Merge branch 'main' into dev
IvanHanloth Jul 26, 2026
60d1e3e
chore(release): v3.1.0-rc.1
github-actions[bot] Jul 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# Boss Key pre-commit:文档与文案的 i18n 一致性检查。
#
# 只在暂存区涉及 docs/、前端或 crates/ 时才跑对应检查,与本次提交无关的部分直接跳过。
# 启用方式(每个克隆一次):git config core.hooksPath .githooks
# 确有需要时可跳过:git commit --no-verify

set -e

root=$(git rev-parse --show-toplevel)

if command -v pwsh >/dev/null 2>&1; then
shell=pwsh
elif command -v powershell >/dev/null 2>&1; then
shell=powershell
else
echo "pre-commit:未找到 PowerShell,跳过 i18n 检查" >&2
exit 0
fi

"$shell" -NoProfile -File "$root/scripts/i18n-check.ps1" -Staged
6 changes: 6 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ jobs:
shell: pwsh
run: ./scripts/version.ps1 check

# ---- 文案:引用的键是否存在、有无死键、Msg 是否登记进 ALL_MSGS ----
# catalog 内部的键集 / 占位符由下面的 npm test 覆盖,这里跳过免得跑两遍。
- name: i18n consistency check
shell: pwsh
run: ./scripts/i18n-check.ps1 -SkipVitest

# ---- 前端:依赖 / 单元测试 / 构建 ----
- name: Frontend install, test & build
run: |
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ on:
push:
branches: ["main", "dev"]
paths:
- "/docs/**"
- "/package.json"
- "/pnpm-lock.yaml"
- "/.github/workflows/deploy-docs.yml"
- "docs/**"
- "scripts/i18n-check.ps1"
- "package.json"
- "pnpm-lock.yaml"
- ".github/workflows/deploy-docs.yml"
release:
types: [published, edited, deleted]
workflow_dispatch:
Expand Down Expand Up @@ -52,8 +53,17 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

# 三语文档配套与站内链接的一致性;跳过 catalog 单测(这里没装前端依赖,
# 那部分由 build-test.yml 的 npm test 覆盖)。
- name: i18n consistency check
shell: pwsh
run: ./scripts/i18n-check.ps1 -SkipVitest

# 旧版客户端仍通过 Pages 上的 releases.json 检查更新,这里用 curl+jq(runner 自带,免安装)
# 重新生成它,替代原来单独的 jekyll-gh-pages 工作流。
#
# 必须滤掉草稿:Actions 的 token 有 push 权限,/releases 会把未发布的草稿一并返回,
# 不过滤就会把还没发的版本推给老客户端。
- name: Update releases.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -62,7 +72,9 @@ jobs:
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/releases" \
| jq 'map({tag_name, published_at, body, assets: [.assets[] | {name, browser_download_url}]}) | sort_by(.published_at)' \
| jq 'map(select(.draft == false)
| {tag_name, published_at, body, assets: [.assets[] | {name, browser_download_url}]})
| sort_by(.published_at)' \
> docs/public/releases.json

- name: Build with VitePress
Expand Down
100 changes: 84 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,93 @@
name: Release

# 构建并发布一个已存在的 tag。
# 构建并发布一个已随合并进入 main 的 tag。
#
# 两种进入方式:
# 1. 直接推送 v* tag(手动打的 tag);
# 2. 由 tag.yml 通过 workflow_call 调用 —— 用默认 GITHUB_TOKEN 推的 tag 不会触发
# 上面的 push 事件,所以 tag.yml 必须显式调用本工作流,而不能指望 tag 推送。
# 触发方式:
# 1. 推送到 main —— tag.yml 事先把版本号提交与 v* tag 落在 dev,等 dev → main 的
# PR 合并,tag 随之进入 main 的历史,这里检测到就构建;
# 2. 手动触发(workflow_dispatch),指定 tag —— 用于重跑或补发。
#
# 为什么不监听 push: tags:tag 是 tag.yml 用 GITHUB_TOKEN 推到 dev 的,那次推送
# 不会触发任何工作流;而 PR 合并本身**不产生 tag 推送事件**(tag 是独立的 ref,
# 合并只是让它指向的提交变得可从 main 追溯)。所以只能从 main 的 push 事件里检测。

on:
push:
tags:
- "v*"
workflow_call:
branches: ["main"]
workflow_dispatch:
inputs:
tag:
description: "要发布的 tag,例如 v3.0.1"
description: "要构建发布的 tag,例如 v3.0.1"
required: true
type: string

concurrency:
group: release-${{ inputs.tag || github.ref_name }}
cancel-in-progress: false

jobs:
# 找出「这次推送新带进 main 的 v* tag」。
# 不能用「HEAD 上挂着的 tag」:merge commit 才是 HEAD,tag 指向的是它的父提交。
detect:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.find.outputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 需要完整历史与全部 tag 才能算可达性

- name: Find newly merged release tag
id: find
env:
INPUT_TAG: ${{ inputs.tag }}
BEFORE: ${{ github.event.before }}
run: |
set -euo pipefail

if [ -n "${INPUT_TAG}" ]; then
echo "手动指定:${INPUT_TAG}"
echo "tag=${INPUT_TAG}" >> "$GITHUB_OUTPUT"
exit 0
fi

# 推送前 main 上已可追溯的 v* tag。新建分支 / 强推时 before 可能不可用,
# 那就当作「之前一个都没有」,让下面取到最新的一个。
if [ -n "${BEFORE:-}" ] && git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then
git tag --merged "${BEFORE}" --list 'v*' | sort > /tmp/before.txt
else
: > /tmp/before.txt
fi
git tag --merged HEAD --list 'v*' | sort > /tmp/after.txt

# 一次合并正常只带进一个;真有多个就取版本号最大的
tag=$(comm -13 /tmp/before.txt /tmp/after.txt | sort -V | tail -n 1)

if [ -z "$tag" ]; then
echo "本次推送没有新的 v* tag 进入 main,跳过发布"
else
echo "检测到新进入 main 的 tag:$tag"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"

build-and-release:
needs: detect
if: needs.detect.outputs.tag != ''
runs-on: windows-latest
permissions:
contents: write
id-token: write # attest-build-provenance 取 OIDC token
attestations: write # 写入构建来源证明
concurrency:
group: release-${{ needs.detect.outputs.tag }}
cancel-in-progress: false
env:
TAG: ${{ inputs.tag || github.ref_name }}
TAG: ${{ needs.detect.outputs.tag }}

steps:
# 构建 tag 指向的那个提交,而不是 main 的 merge commit:
# 前者才是版本号提交本身,与 version.ps1 check 的校验对象一致。
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
ref: ${{ needs.detect.outputs.tag }}

# tag 与代码里的版本号必须一致,否则装出来的包版本号是错的
- name: Verify version matches tag
Expand Down Expand Up @@ -103,12 +154,29 @@ jobs:
# /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 `
# "dist/Boss-Key/Boss Key.exe" dist/Boss-Key/config.exe dist/installer/Boss-Key-*-Setup.exe

# 发布说明 = GitHub 自动生成的更新日志 + 结尾的安全提示。
# 创建 Release 时若同时传 body 和 generate_release_notes,自定义内容只会被
# 放在自动生成内容**之前**,所以这里先调 generate-notes API 拿到更新日志,
# 再手动把安全提示拼在末尾。
- name: Compose release notes
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$notes = (gh api "repos/$env:GITHUB_REPOSITORY/releases/generate-notes" -f tag_name="$env:TAG" --jq '.body') -join "`n"
$notice = @'
> [!WARNING]
> 【安全提示】
> 本软件中运用了大量的系统底层API,并且提供开机自启、热键监控、窗口冻结等功能,容易被杀毒软件识别为木马病毒,但是程序本身完全开源、免费,并不包含病毒、木马行为,请放心使用。请务必从官方渠道下载和使用程序,运行程序前通过文件哈希、文件签名等方式验证文件的真实性,谨防利用软件信任伪装的病毒程序。
'@
Set-Content -Path release-notes.md -Value ($notes + "`n`n" + $notice) -Encoding utf8

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Boss Key ${{ env.TAG }}
tag_name: ${{ env.TAG }}
generate_release_notes: true
body_path: release-notes.md
draft: true
prerelease: ${{ steps.version.outputs.is_prerelease == 'true' }}
make_latest: ${{ steps.version.outputs.is_prerelease != 'true' }}
Expand Down
95 changes: 76 additions & 19 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: Bump version and tag

# 手动触发的发版入口:填一个版本号,工作流会
# 手动触发的发版准备。**请从 dev 分支触发**(bot 已在 dev 的分支保护里放行)。
#
# 流程:
# 1. 把版本号写进 Cargo.toml / tauri.conf.json / package.json / Cargo.lock;
# 2. 提交这次改动并推回当前分支,然后打上 v<版本号> 的 tag 并推送;
# 3. 调用 release.yml 构建并发布 GitHub Release。
# 2. 提交到 dev 并打上 v<版本> tag,两者一起推送;
# 3. 确保有一个 dev → main 的 PR(没有就开一个)。
#
# 这里**不构建**。用 GITHUB_TOKEN 推的 tag 不会触发任何工作流,正合本流程的意图:
# 等你把 PR 合并进 main、tag 随之进入 main 的历史,release.yml 才开始生产构建。
#
# ⚠ 合并该 PR 时请用 **merge commit**(不要 squash / rebase):
# tag 指向 dev 上的那个提交,squash 会另造提交,tag 就进不了 main 的历史,
# release.yml 也就检测不到、不会构建。

on:
workflow_dispatch:
Expand All @@ -12,18 +21,34 @@ on:
description: "要发布的版本号,例如 3.0.1 或 3.1.0-rc.1(可带前导 v)"
required: true
type: string
base:
description: "发版 PR 的目标分支"
required: false
default: main
type: string

jobs:
bump:
runs-on: windows-latest
permissions:
contents: write
outputs:
tag: ${{ steps.bump.outputs.tag }}
contents: write # 推版本号提交与 tag
pull-requests: write # 开发版 PR
steps:
- name: Checkout repository
uses: actions/checkout@v4

# 从 main 触发的话,下面的 PR 会变成 main → main
- name: Reject running from the base branch
shell: pwsh
env:
SOURCE: ${{ github.ref_name }}
BASE: ${{ inputs.base }}
run: |
if ($env:SOURCE -eq $env:BASE) {
Write-Host "::error::本工作流应从 dev 触发,当前分支 $env:SOURCE 与目标分支相同"
exit 1
}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

Expand All @@ -35,7 +60,7 @@ jobs:
shell: pwsh
run: ./scripts/version.ps1 apply "${{ inputs.version }}"

- name: Commit, tag and push
- name: Commit and tag
id: bump
shell: pwsh
env:
Expand All @@ -56,21 +81,53 @@ jobs:

git add Cargo.toml Cargo.lock apps/config/src-tauri/tauri.conf.json apps/config/ui/package.json
git commit -m "chore(release): $tag"
git tag $tag
if ($LASTEXITCODE -ne 0) { throw "提交版本号失败(版本号是否已经是 $env:VERSION?)" }

# 带 message 的附注 tag(git describe 认它)。显式关掉签名:
# 机器人没有密钥,谁要是在本机跑这套命令,全局的 tag.gpgsign 会让裸 git tag 直接失败。
git -c tag.gpgSign=false tag -a $tag -m "Boss Key $tag"
if ($LASTEXITCODE -ne 0) { throw "创建 tag $tag 失败" }

git push origin "HEAD:$env:BRANCH"
if ($LASTEXITCODE -ne 0) { throw "推送 $env:BRANCH 失败(bot 是否已在分支保护里放行?)" }
git push origin "refs/tags/$tag"
if ($LASTEXITCODE -ne 0) { throw "推送 tag $tag 失败(仓库是否配了 tag 保护规则?)" }

"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8

# 构建并发布刚刚推上去的 tag
release:
needs: bump
permissions:
contents: write
id-token: write
attestations: write
uses: ./.github/workflows/release.yml
secrets: inherit
with:
tag: ${{ needs.bump.outputs.tag }}
# 发版 PR 通常已经存在(你正准备把 dev 合进 main),没有才开一个。
# 用 PAT 开的 PR 才会触发 build-test.yml;退回 GITHUB_TOKEN 时 PR 上没有检查记录,
# 但你点 Merge 触发的 push 事件仍会正常跑 build-test.yml。
- name: Ensure release pull request
shell: pwsh
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
TAG: ${{ steps.bump.outputs.tag }}
BASE: ${{ inputs.base }}
SOURCE: ${{ github.ref_name }}
run: |
$existing = gh pr list --base $env:BASE --head $env:SOURCE --state open --json url --jq '.[0].url'
if ($existing) {
Write-Host "已有 $env:SOURCE → $env:BASE 的 PR:$existing"
Write-Host "版本号提交与 tag $env:TAG 已经在这个 PR 里了"
exit 0
}

$body = @"
由 ``tag.yml`` 自动创建。

- 版本号已写入 Cargo.toml / tauri.conf.json / package.json / Cargo.lock
- tag ``$env:TAG`` 已指向 ``$env:SOURCE`` 上的版本号提交

合并后 tag 随之进入 ``$env:BASE`` 的历史,``release.yml`` 会检测到并开始生产构建。

请用 **merge commit** 合并(不要 squash / rebase),否则 tag ``$env:TAG``
进不了 ``$env:BASE`` 的历史,构建不会触发。
"@

# 经文件传正文:中文走命令行参数有被终端编码改写的风险,写成 UTF-8 文件更稳
[System.IO.File]::WriteAllText("pr-body.md", $body, (New-Object System.Text.UTF8Encoding($false)))

gh pr create --base $env:BASE --head $env:SOURCE `
--title "release: $env:TAG" --body-file pr-body.md
if ($LASTEXITCODE -ne 0) { throw "创建发版 PR 失败" }
Loading
Loading