build: improve release packaging and updater
This commit is contained in:
1 parent
58f23a2773
commit
d4b21f0bdb
3 files changed
+45
-23
No files matched your search
@@ -108,6 +108,22 @@ CGO_ENABLED=0 go build -tags embedui -o artex ./cmd/artex
|
||||
./artex
|
||||
```
|
||||
|
||||
### 方式五:构建跨平台 Release 压缩包
|
||||
|
||||
`build.sh` 会先构建并嵌入前端,再使用 Go linker 去除调试信息,并将发布文件压缩为 zip。Release 模式默认生成 Linux amd64/arm64、macOS amd64/arm64 和 Windows amd64 的 zip 包:
|
||||
|
||||
```bash
|
||||
./build.sh --release
|
||||
# 产物:dist/artex-0.3.3-*.zip
|
||||
```
|
||||
|
||||
UPX 自解压二进制可能与部分 Linux 内核、虚拟化环境或安全策略不兼容,因此默认不启用。可用 `ARTEX_TARGETS` 自定义目标;确认目标运行环境兼容时,可显式传入 `--upx` 进一步缩小二进制:
|
||||
|
||||
```bash
|
||||
ARTEX_TARGETS=linux/amd64,windows/amd64 ./build.sh --release
|
||||
./build.sh --target linux/amd64 --upx
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 更新升级
|
||||
|
||||
Reference in new issue
Block a user