最新版查询改走 API:这台 Gitea 没有 latest/download 路由
/releases/latest/download/<asset> 实测 404,只有带具体 tag 的 下载路径可用。版本号从 /api/v1/.../releases/latest 拿, version.txt 因此不再需要单独作为 asset 上传。
This commit is contained in:
@@ -32,11 +32,8 @@ jobs:
|
||||
bun build --target=bun --minify server/index.ts --outfile dist/patchbay/server/index.js
|
||||
cp -r web-dist dist/patchbay/web-dist
|
||||
echo "${GITHUB_REF_NAME}" > dist/patchbay/version.txt
|
||||
cp dist/patchbay/version.txt version.txt
|
||||
tar -czf patchbay.tar.gz -C dist patchbay
|
||||
|
||||
# version.txt 单独作为 asset 再传一份,install.sh check 用它比对版本,
|
||||
# 不用把整个 tarball 拉下来。
|
||||
# 直接 curl Gitea 的 API 而不用现成 action:gitea.com/actions/release-action
|
||||
# 是 Go 程序,runner 镜像里没有 Go 工具链,跑不起来
|
||||
- name: 发布 Release
|
||||
@@ -55,8 +52,6 @@ jobs:
|
||||
# 响应里第一个 "id" 就是 release 自己的(嵌套对象如 author 排在它后面)
|
||||
id="$(printf '%s' "$resp" | grep -o '"id":[0-9]*' | head -n1 | cut -d: -f2)"
|
||||
[ -n "$id" ] || { echo "没拿到 release id,响应: $resp"; exit 1; }
|
||||
for f in patchbay.tar.gz version.txt; do
|
||||
curl -fsS -X POST -H "$auth" -F "attachment=@${f}" \
|
||||
"$api/releases/${id}/assets?name=${f}" >/dev/null
|
||||
echo "已上传 $f"
|
||||
done
|
||||
curl -fsS -X POST -H "$auth" -F "attachment=@patchbay.tar.gz" \
|
||||
"$api/releases/${id}/assets?name=patchbay.tar.gz" >/dev/null
|
||||
echo "已上传 patchbay.tar.gz"
|
||||
|
||||
Reference in New Issue
Block a user