fix(V0.2): 版本规则收尾 —— 手动 OTA 工作流对齐发布说明/commit 口径
Docker Build and Push / build-image (push) Successful in 1m1s
Docker Build and Push / build-image (push) Successful in 1m1s
- ota-build.yml: notes 默认取检出 commit 的 message, --commit 写入 manifest (与 docker-build 一致); 参数加引号防空格断裂 - docker-build.yml: 去掉 head -c 400 字节截断 (会把多字节汉字切成 非法 UTF-8 导致 latest.json 解析失败), 截断统一由打包脚本按字符处理 - build-ota.mjs: CI 日志输出 build_id 与 commit
This commit is contained in:
@@ -66,18 +66,23 @@ jobs:
|
||||
minisign -v
|
||||
|
||||
- name: Build & sign OTA package
|
||||
# 发布说明默认 = 检出 commit 的 message (标题+正文), commit sha 单独写入;
|
||||
# 手动填写的 notes 优先
|
||||
env:
|
||||
MINISIGN_PRIVATE_KEY: ${{ secrets.MINISIGN_PRIVATE_KEY }}
|
||||
OTA_NOTES: ${{ inputs.notes }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
OUT="ota-package"
|
||||
ARGS="--out ${OUT}"
|
||||
# sequence 留空 → 脚本默认用时间戳; min_binary 默认 0.1.0 (与前端版本解耦)
|
||||
ARGS="--out ${OUT} --commit ${GITHUB_SHA}"
|
||||
if [ -n "${{ inputs.sequence }}" ]; then ARGS="${ARGS} --sequence ${{ inputs.sequence }}"; fi
|
||||
if [ -n "${OTA_NOTES}" ]; then ARGS="${ARGS} --notes ${OTA_NOTES}"; fi
|
||||
if [ -n "${{ inputs.notes }}" ]; then
|
||||
ARGS="${ARGS} --notes \"${{ inputs.notes }}\""
|
||||
else
|
||||
MSG="$(git log -1 --pretty=format:%B | sed -e '/^[[:space:]]*$/d')"
|
||||
ARGS="${ARGS} --notes \"${MSG}\""
|
||||
fi
|
||||
if [ -n "${{ inputs.min_binary }}" ]; then ARGS="${ARGS} --min-binary ${{ inputs.min_binary }}"; fi
|
||||
node scripts/build-ota.mjs ${ARGS}
|
||||
eval "node scripts/build-ota.mjs ${ARGS}"
|
||||
echo "===== latest.json ====="
|
||||
cat ${OUT}/latest.json
|
||||
echo "===== bundle sha256 ====="
|
||||
|
||||
Reference in New Issue
Block a user