docs: simplify portable installation

This commit is contained in:
roy1994 2026-08-23 05:39:24 +08:00
parent e3764c0509
commit 14b89c4208

View File

@ -14,38 +14,24 @@ python3 -m pip install --user --no-deps --no-build-isolation .
如果不想安装,也可以直接运行 `python3 run_ictlogin.py ...`。 如果不想安装,也可以直接运行 `python3 run_ictlogin.py ...`。
## 单文件发布 ## 单文件安装
构建可直接复制到其他 Linux 服务器的 zipapp: 服务器上可直接从公开 Release 获取并安装单文件程序:
```bash
python3 scripts/build_release.py
./dist/ictlogin.pyz --version
(cd dist && sha256sum -c ictlogin.pyz.sha256)
```
`dist/` 只用于本地构建,已被 Git 忽略。维护者可以将构建产物上传到 Gitea Release:
```bash
tea releases assets create --repo mancitrus/ictlogin v0.2.0 \
dist/ictlogin.pyz dist/ictlogin.pyz.sha256 install.sh
```
服务器上可直接从公开仓库获取安装脚本并安装当前 Release:
```bash ```bash
curl --fail --location https://gitx.roy1994.top/mancitrus/ictlogin/raw/branch/main/install.sh | sh curl --fail --location https://gitx.roy1994.top/mancitrus/ictlogin/raw/branch/main/install.sh | sh
``` ```
也可以在本地保存 `install.sh` 后执行: 安装脚本默认下载 `v0.2.0` Release 中的 `ictlogin.pyz`,验证对应的 SHA-256 后写入 `~/.local/bin/ictlogin`。需要其他版本时设置 Release 标签:
```bash
ICTLOGIN_RELEASE_TAG=v0.2.0 ./install.sh
```
也可以先保存 `install.sh`,再从已有的本地文件或自定义 URL 安装:
```bash ```bash
./install.sh ./install.sh
```
安装脚本默认从公开的 `v0.2.0` Release 下载 `ictlogin.pyz` 及其 `.sha256` 校验文件,写入 `~/.local/bin/ictlogin`。可通过 `ICTLOGIN_RELEASE_TAG` 选择其他 Release。也可以从指定文件或 URL 安装:
```bash
./install.sh --source /path/to/ictlogin.pyz --prefix "$HOME/.local/bin" ./install.sh --source /path/to/ictlogin.pyz --prefix "$HOME/.local/bin"
ICTLOGIN_PYZ_URL="https://example.invalid/ictlogin.pyz" ./install.sh ICTLOGIN_PYZ_URL="https://example.invalid/ictlogin.pyz" ./install.sh
ICTLOGIN_PYZ_URL="https://example.invalid/ictlogin.pyz" \ ICTLOGIN_PYZ_URL="https://example.invalid/ictlogin.pyz" \