Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 29 additions & 4 deletions .github/workflows/aur.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Publish AUR packages

on:
pull_request:
paths:
- 'packaging/arch/**'
- 'packaging/aur/**'
- 'scripts/aur.py'
- 'scripts/release.py'
- 'scripts/publish-aur.sh'
- 'tests/aur.test.py'
- '.github/workflows/aur.yml'
push:
branches: [main]
paths:
Expand All @@ -12,7 +21,7 @@ on:
workflow_dispatch:
inputs:
tag:
description: Stable server-v or cli-v tag for -bin; leave empty for both -git packages
description: Stable server-v, cli-v or desktop-v tag for -bin; leave empty for all -git packages
type: string
default: ''
workflow_call:
Expand All @@ -34,8 +43,24 @@ concurrency:
queue: max

jobs:
verify:
name: Verify recipes with Arch makepkg
runs-on: ubuntu-24.04
container: archlinux:base-devel
timeout-minutes: 10
steps:
- name: Install recipe validation tools
run: pacman -Syu --noconfirm --needed git python
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Verify metadata and component file boundaries without root
run: |
useradd -m builder
runuser -u builder -- python tests/aur.test.py
bash -n scripts/publish-aur.sh

publish:
if: vars.AUR_PUBLISH_ENABLED == 'true'
needs: verify
if: github.event_name != 'pull_request' && vars.AUR_PUBLISH_ENABLED == 'true'
runs-on: ubuntu-24.04
container: archlinux:base-devel
timeout-minutes: 15
Expand Down Expand Up @@ -66,14 +91,14 @@ jobs:
RELEASE_TAG: ${{ inputs.tag }}
run: |
if [[ -n "$RELEASE_TAG" ]]; then
[[ "$RELEASE_TAG" =~ ^(server|cli)-v[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
[[ "$RELEASE_TAG" =~ ^(server|cli|desktop)-v[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
product=${RELEASE_TAG%%-v*}
python scripts/fetch-release-manifest.py "$RELEASE_TAG" "$RUNNER_TEMP/aur-manifest"
chmod -R a+rX "$RUNNER_TEMP/aur-manifest"
runuser -u builder -- python scripts/aur.py --product "$product" --variant bin \
--manifest "$RUNNER_TEMP/aur-manifest/downloads.json" --out dist/aur
else
for product in server cli; do
for product in server cli desktop; do
runuser -u builder -- python scripts/aur.py --product "$product" --variant git --out dist/aur
done
fi
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
run: |
python3 tests/cli-scripts.test.py
python3 tests/release.test.py
python3 tests/desktop-signing.test.py
python3 tests/aur.test.py
python3 scripts/release.py docs --check

Expand Down
79 changes: 76 additions & 3 deletions .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@ name: Desktop and CLI packages
on:
push:
tags: ['desktop-v*']
pull_request:
paths:
- 'desktop/**'
- 'packaging/flatpak/**'
- 'packaging/aur/**'
- 'release/**'
- 'scripts/release.py'
- 'scripts/desktop-signing.py'
- 'scripts/aur.py'
- 'scripts/package-flatpak.sh'
- 'tests/release.test.py'
- 'tests/desktop-signing.test.py'
- 'tests/aur.test.py'
- '.github/workflows/desktop-release.yml'
workflow_dispatch:
inputs:
require_signing:
description: Require real Windows publisher signing and macOS Developer ID notarization (does not publish)
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -32,6 +51,8 @@ jobs:
- name: Verify catalog, generated docs and package boundaries
run: |
python3 tests/release.test.py
python3 tests/desktop-signing.test.py
python3 tests/aur.test.py
python3 scripts/release.py docs --check
bash -n scripts/package-flatpak.sh
cargo fmt --manifest-path desktop/src-tauri/Cargo.toml -- --check
Expand Down Expand Up @@ -70,11 +91,31 @@ jobs:
matrix: ${{ fromJSON(needs.prepare.outputs.desktop) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
env:
# PR code never receives signing secrets. Tag releases always require them.
DESKTOP_REQUIRE_SIGNATURES: ${{ github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) }}
WINDOWS_CERTIFICATE: ${{ matrix.platform == 'Windows' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.WINDOWS_CERTIFICATE || '' }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ matrix.platform == 'Windows' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.WINDOWS_CERTIFICATE_PASSWORD || '' }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ matrix.platform == 'Windows' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.WINDOWS_CERTIFICATE_THUMBPRINT || '' }}
WINDOWS_TIMESTAMP_URL: ${{ matrix.platform == 'Windows' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && vars.WINDOWS_TIMESTAMP_URL || '' }}
APPLE_CERTIFICATE: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_CERTIFICATE || '' }}
APPLE_CERTIFICATE_PASSWORD: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
APPLE_SIGNING_IDENTITY: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_SIGNING_IDENTITY || '' }}
APPLE_ID: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_ID || '' }}
APPLE_PASSWORD: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_TEAM_ID || '' }}
APPLE_API_ISSUER: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_API_ISSUER || '' }}
APPLE_API_KEY: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_API_KEY || '' }}
APPLE_API_KEY_BASE64: ${{ matrix.platform == 'macOS' && github.event_name != 'pull_request' && (github.ref_type == 'tag' || inputs.require_signing == true) && secrets.APPLE_API_KEY_BASE64 || '' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Check required signing credentials before building
env:
TARGET: ${{ matrix.target }}
run: python3 scripts/desktop-signing.py configure --target "$TARGET" --out "$RUNNER_TEMP/desktop-signing.json"
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: '24'
Expand Down Expand Up @@ -117,20 +158,43 @@ jobs:
TARGET: ${{ matrix.target }}
BUNDLES: ${{ matrix.bundles }}
APPIMAGE_EXTRACT_AND_RUN: '1'
run: npm run tauri -- build --ci --target "$TARGET" --bundles "$BUNDLES" -- --locked
run: |
# Empty secrets must be absent: Tauri treats set-but-empty Apple env
# variables as supplied signing inputs on some paths.
for name in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY \
APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID APPLE_API_ISSUER APPLE_API_KEY APPLE_API_KEY_PATH; do
if [[ -z ${!name:-} ]]; then unset "$name"; fi
done
unset WINDOWS_CERTIFICATE WINDOWS_CERTIFICATE_PASSWORD APPLE_API_KEY_BASE64
npm run tauri -- build --ci --target "$TARGET" --bundles "$BUNDLES" --config "$RUNNER_TEMP/desktop-signing.json" -- --locked
- name: Start the Linux desktop launcher under a real WebKit view
if: runner.os == 'Linux'
env:
TARGET: ${{ matrix.target }}
run: |
dbus-run-session -- xvfb-run -a \
"desktop/src-tauri/target/$TARGET/release/hireferry-desktop" --smoke-test
- name: Start the Windows or macOS launcher under its native WebView
if: runner.os != 'Linux'
env:
TARGET: ${{ matrix.target }}
run: |
python3 - <<'PY'
import os, pathlib, subprocess, sys
suffix = '.exe' if sys.platform == 'win32' else ''
binary = pathlib.Path('desktop/src-tauri/target')/os.environ['TARGET']/'release'/('hireferry-desktop'+suffix)
subprocess.run([str(binary.resolve()), '--smoke-test'], check=True, timeout=45)
PY
- name: Normalize packages and record checksums
env:
TARGET: ${{ matrix.target }}
run: |
python3 scripts/release.py stage-desktop --target "$TARGET" \
--bundle-dir "desktop/src-tauri/target/$TARGET/release/bundle" --out dist/desktop
python3 scripts/desktop-signing.py verify --target "$TARGET" --directory dist/desktop
- name: Delete temporary notarization key
if: always()
run: rm -f "$RUNNER_TEMP/hireferry-notary-key.p8" "$RUNNER_TEMP/desktop-signing.json"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: desktop-release-${{ matrix.target }}
Expand Down Expand Up @@ -199,9 +263,10 @@ jobs:
- name: Validate every required package and generate Markdown, SVG and JSON
env:
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
DISTRIBUTION: ${{ github.event_name == 'push' && github.ref_type == 'tag' && 'release' || 'engineering' }}
run: |
python3 scripts/release.py assemble artifacts/release dist/release \
--tag "$RELEASE_TAG" --repository "$GITHUB_REPOSITORY" --commit "$GITHUB_SHA"
--tag "$RELEASE_TAG" --repository "$GITHUB_REPOSITORY" --commit "$GITHUB_SHA" --distribution "$DISTRIBUTION"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: complete-desktop-release
Expand All @@ -218,6 +283,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: complete-desktop-release
Expand All @@ -228,7 +294,7 @@ jobs:
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
run: |
(cd dist/release && sha256sum -c SHA256SUMS)
python3 scripts/release.py verify-publication dist/release
state=$(gh release view "$RELEASE_TAG" --json isDraft --jq .isDraft 2>/dev/null || printf missing)
if [[ "$state" == false ]]; then
echo 'This release is already published; bump the desktop version.' >&2
Expand All @@ -248,3 +314,10 @@ jobs:
uses: ./.github/workflows/release-docs.yml
with:
tag: ${{ needs.prepare.outputs.tag }}

update-aur:
needs: [prepare, publish]
uses: ./.github/workflows/aur.yml
secrets: inherit
with:
tag: ${{ needs.prepare.outputs.tag }}
5 changes: 4 additions & 1 deletion desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
name = "hireferry-desktop"
version = "0.1.0"
edition = "2024"
rust-version = "1.88"
rust-version = "1.90"
description = "HireFerry desktop client"
authors = ["HireFerry contributors"]
license = "AGPL-3.0-or-later"
repository = "https://github.com/TokenNotIncluded/hireferry"

[features]
custom-protocol = ["tauri/custom-protocol"]

# The desktop toolchain is deliberately independent of the server/CLI workspace.
[workspace]
resolver = "3"
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/release-matrix.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 24 additions & 5 deletions docs/aur.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

[下载矩阵](downloads.md) · [CLI](cli.md) · [自托管](self-hosting.md)

服务端和客户端 CLI 是独立软件包,都支持 x86_64 与 aarch64:
服务端、客户端 CLI 与桌面 GUI 独立打包,都面向 x86_64 与 aarch64:

| 组件 | 从 main 编译 | 安装正式 Release 二进制 |
| --- | --- | --- |
| 服务端 `hireferry` | `hireferry-server-git` | `hireferry-server-bin` |
| 客户端 `hfy` | `hireferry-cli-git` | `hireferry-cli-bin` |
| 桌面 GUI `hireferry-desktop` | 仓库已提供 `hireferry-desktop-git` 配方 | 正式桌面 Release 成功后生成 `hireferry-desktop-bin` |

同一组件的 `-git` 和 `-bin` 提供相同命令,因此互斥。服务端与 CLI 的文件互不重叠,可以同时安装,也可以混用不同变体。安装 CLI 不会安装、编译或启动服务端。桌面 GUI 继续使用[桌面安装包](desktop.md)。
同一组件的 `-git` 和 `-bin` 提供相同命令,因此互斥。不同组件使用独立的可执行文件与文档目录,可以同时安装,也可以混用不同变体。安装 CLI 或桌面 GUI 不会安装、编译或启动服务端。桌面 GUI 连接已有站点。

**桌面 AUR 当前状态:** 此次变更新增配方与发布流程,尚未把“仓库中有 PKGBUILD”视为 AUR 已上架。2026-10-22 核对时没有正式桌面 Release,因此不提交占位的 `-bin` URL 或校验和。main 合入后 AUR 工作流才能更新源码配方;`-bin` 必须等待完整、通过签名门槛的桌面 Release。实际 AUR 发布成功后才能使用对应包名安装。

```sh
# 连接现有站点,只需要 CLI
Expand All @@ -26,6 +29,14 @@ yay -S hireferry-server-git

也可克隆对应 AUR 仓库,用 `makepkg -si` 构建安装。`-git` 使用锁定依赖,版本由 Cargo 版本、提交数和提交 ID 组成;`-bin` 固定版本和两个架构各自的 SHA-256,不在安装时查询 latest,也不跳过二进制校验。

## 桌面源码配方与二进制配方

源码配方位于 [`packaging/aur/hireferry-desktop-git`](../packaging/aur/hireferry-desktop-git/PKGBUILD)。在 Arch 系统上复制该目录,检查配方后运行 `makepkg --cleanbuild -si`。它使用独立的 `desktop/src-tauri/Cargo.toml`、锁定依赖与 `custom-protocol` feature,仅构建 `hireferry-desktop`,不要求 Node 构建步骤或服务器 Cargo workspace。Rust 需至少 1.90;运行依赖包含 GTK 3、WebKitGTK 4.1、libsoup 3、OpenSSL 和桌面图标支持。桌面菜单与 SVG 图标分别安装到标准的 applications 与 icons 目录。

二进制生成器只从经过验证的正式 `downloads.json` 选择两种 Linux 架构的 `.deb`;AUR 的 `makepkg` 下载并按 `sha256sums_<arch>` 校验后解出 Debian 容器,`package()` 再用 `bsdtar` 安装其中的 `data.tar.*`。配方不执行 `.deb` 的安装维护脚本,不查询 latest,不将校验设置为 SKIP。它只接受单个 payload,并检查桌面程序存在、服务端与 CLI 可执行文件不存在。

Windows / macOS 的签名策略属于整个正式桌面 Release 的门槛;Linux `.deb` 仍明确只提供 SHA-256 校验,没有因此宣称 Linux 包也具有 Authenticode 或 Apple 签名。签名工程产物和没有验签报告的候选清单不能用于生成公开二进制配方。

## 服务端初始化

包安装 `/usr/bin/hireferry`、`hireferry.service`、systemd sysusers 与 tmpfiles 配置。它不自动开启服务、不生成管理员凭据,也不写入生产密钥。配置模板位于 `/usr/share/hireferry/config.example.toml`。
Expand Down Expand Up @@ -53,24 +64,32 @@ CLI 的 Agent Skill 位于 `/usr/share/hireferry-cli/skills/hireferry`,可用
| --- | --- | --- | --- |
| 服务端 | 根 `Cargo.toml` | `server-vX.Y.Z` | Linux x86_64 / aarch64 归档、下载矩阵、`hireferry-server-bin` |
| CLI | `crates/hireferry-cli/Cargo.toml` | `cli-vX.Y.Z` | 六个平台归档、下载矩阵、`hireferry-cli-bin` |
| 桌面 | Tauri / Cargo / npm 同步版本 | `desktop-vX.Y.Z` | 桌面与所含 CLI 归档、下载矩阵 |
| 桌面 | Tauri / Cargo / npm 同步版本 | `desktop-vX.Y.Z` | 桌面与所含 CLI 归档、下载矩阵、`hireferry-desktop-bin` |

发布工作流汇总全部目标,通过完整性和 SHA-256 校验后才发布 GitHub Release。AUR 工作流下载已发布的 `downloads.json` 并用 `SHA256SUMS` 校验,然后生成固定版本的 `PKGBUILD` 和 `.SRCINFO`。旧版本重跑不会降级 AUR 包。修改 AUR 配方、公共 Arch 安装文件或生成器后,main 分支推送会更新两个 `-git` 包。
发布工作流汇总全部目标,通过完整性和 SHA-256 校验后才发布 GitHub Release。AUR 工作流下载已发布的 `downloads.json` 并用 `SHA256SUMS` 校验,然后生成固定版本的 `PKGBUILD` 和 `.SRCINFO`。旧版本重跑不会降级 AUR 包。修改 AUR 配方、公共 Arch 安装文件或生成器后,main 分支推送会更新三个 `-git` 包。PR 在 Arch `base-devel` 容器中以非 root 用户检查 `.SRCINFO` 和实际配方的文件安装边界;该测试不代替完整编译、安装和图形会话实测。

GitHub 仓库需要配置:

- `AUR_PUBLISH_ENABLED=true` 仓库变量。
- `AUR_SSH_PRIVATE_KEY`:已登记到维护者 AUR 账户的自动发布 SSH 私钥。
- `AUR_KNOWN_HOSTS`:通过可信渠道核实的 `aur.archlinux.org` 主机记录。工作流强制核验主机,不临时信任扫描结果。

发布仅推送配方与必要的 systemd 文件,不上传二进制到 AUR,不强制推送。每个包发布后核对 AUR 远端提交。也可手动生成并发布:
发布仅推送配方、必要的 systemd 文件与桌面二进制包的许可证,不上传二进制到 AUR,不强制推送。每个包发布后核对 AUR 远端提交。也可手动生成并发布:

```sh
python3 scripts/aur.py --product server --variant git
python3 scripts/aur.py --product cli --variant git
python3 scripts/aur.py --product desktop --variant git
python3 scripts/fetch-release-manifest.py server-v0.1.0 dist/server-manifest
python3 scripts/aur.py --product server --variant bin --manifest dist/server-manifest/downloads.json
bash scripts/publish-aur.sh packaging/aur/hireferry-server-bin
```

日常验证在本地完成:`python3 tests/release.test.py`、`python3 tests/aur.test.py`、`python3 scripts/release.py docs --check`。实际构建可运行 `makepkg --cleanbuild`;ARM64 包需要在对应架构构建和运行后,才能声称完成该架构的运行验收。

桌面正式 Release 发布后,再执行以下同样的校验入口;版本必须换成实际已发布标签:

```sh
python3 scripts/fetch-release-manifest.py desktop-vX.Y.Z dist/desktop-manifest
python3 scripts/aur.py --product desktop --variant bin --manifest dist/desktop-manifest/downloads.json
```
Loading