Files
xxxig/README.md
T
wangdefa f9e2d3310f
CI / validate (push) Successful in 5s
CI / build (amd64) (push) Successful in 22s
CI / build (arm64) (push) Successful in 3m48s
Release / build (amd64) (push) Successful in 28s
Release / build (arm64) (push) Successful in 3m30s
Release / release (push) Successful in 35s
新增 CI 和 Release 流水线,优化构建与发布流程,添加 VERSION 文件以统一版本管理
2026-08-05 13:10:52 +08:00

84 lines
3.4 KiB
Markdown
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.
# XXXig
XXXig 是 [XMRig](https://github.com/xmrig/xmrig) 的定制构建——带 CC(Central Control 集中管理)功能的 RandomX CPU 挖矿软件套件。
**本仓库只包含构建与打包基础设施**,不含矿机源码:二进制在 CI 中从上游源码仓库 `github.com/wangdefaa/xxxig` 编译,再打包分发到 [gitea.bcde.io](https://gitea.bcde.io) 的 Generic / Debian 包仓库。
## 产物
每次构建产出三个可执行文件(CPU-only,musl 全静态,含 libuv/OpenSSL/hwloc,无外部动态库依赖,任意 Linux 发行版可跑):
| 二进制 | 作用 |
|---|---|
| `xxxig` | 实际挖矿程序,由 daemon 拉起 |
| `xxxigDaemon` | 守护进程,控制矿机并通过 cc-client 连接中心服务器;安装后作为主服务运行 |
| `xxxigServer` | 中心控制服务器,带 Web UI |
支持架构 `amd64` / `arm64`;musl 全静态,任意 Linux 发行版(Debian/Ubuntu/Alpine/CentOS 等)开箱即跑。
## 安装
完整参数、服务管理、故障排查见 [script/README.md](script/README.md)。
```bash
# tar.gz(通用:Alpine / Ubuntu / Debian)
sudo bash <(wget --no-check-certificate -qO- 'https://gitea.bcde.io/wangdefa/xxxig/raw/branch/main/script/install.sh') \
-o pool.example.com:3333 \
-w YOUR_WALLET
# APT(Debian / Ubuntu)
sudo bash <(wget --no-check-certificate -qO- 'https://gitea.bcde.io/wangdefa/xxxig/raw/branch/main/script/install.deb.sh') \
-o pool.example.com:3333 \
-w YOUR_WALLET
# 卸载(自动识别安装方式)
sudo bash <(wget --no-check-certificate -qO- 'https://gitea.bcde.io/wangdefa/xxxig/raw/branch/main/script/uninstall.sh')
```
两种渠道的安装布局不同:
| | tar.gz | .deb / APT |
|---|---|---|
| 来源 | Generic Package Registry | Debian Package Registry |
| 二进制 | `/etc/miner/xxxig/` | `/opt/xxxig/` |
| 配置 | `/etc/miner/xxxig/config.json` | `/etc/xxxig/config.json`、`config_cc.json` |
| 服务 | 单个 `xxxig` | `xxxig-daemon` + `xxxig-server` |
## 构建与发布
Gitea Actions 分为两条流水线:
- [.gitea/workflows/ci.yml](.gitea/workflows/ci.yml):分支推送时检查版本和 shell 语法,并在 amd64、arm64 原生 runner 上编译、冒烟测试和验证 DEB 包内容。
- [.gitea/workflows/release.yml](.gitea/workflows/release.yml):tag 推送时构建 tar.gz 和 DEB,生成 `SHA256SUMS`,上传包仓库并创建或更新 Release。
本地构建:
```bash
# 编译某架构/发行版二进制(输出到 ./output/linux_<arch>/)
docker buildx build --platform linux/amd64 \
--build-arg XXXIG_VERSION="v$(cat VERSION)" \
--output type=local,dest=./output \
-f docker/Dockerfile .
# 用产物 tar.gz 打 .deb
./debian/build-deb.sh amd64 6.26.0 xxxig-amd64-linux-static-6.26.0.tar.gz
```
## 版本号约定
- 根目录 [VERSION](VERSION) 是唯一版本来源,使用不带 `v` 的版本号。
- **上游源码 git tag** 带 `v`(如 `v6.26.0`),CI 构建时自动补回。
- **包版本**(tar.gz / deb / registry 路径)一律用数字(如 `6.26.0`),符合 Debian 版本规范。
- 发布 tag 可写成 `6.26.0` 或 `v6.26.0`,去掉 `v` 后必须与 VERSION 一致。
发版时先更新 VERSION 并提交,再创建同版本 tag。
## 目录结构
```
.gitea/workflows/ CI 流水线
docker/ Dockerfile(musl 全静态,从上游源码编译)
debian/ .deb 打包:control 模板、维护脚本、systemd 服务
script/ 安装/卸载脚本 + 详细文档
```