Files
pure-note/.gitea/workflows/release.yml
T
wangairnan 95cac4688d
Release / release (push) Failing after 2m8s
fix(ci): 发版 job 显式使用 node 容器镜像
runner 默认镜像无 node,checkout/setup-go/release 等 JS 类 action
第一步即失败(Cannot find: node in PATH)。改用 node:24-bookworm
镜像(自带 node 与 git),并省去 setup-node 步骤。
2026-09-09 23:00:32 +08:00

66 lines
2.0 KiB
YAML
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.
# 发版工作流:推送 v* 标签 → 构建前端并嵌入 → 交叉编译多平台二进制
# → 生成发布说明 → 创建 Gitea Release 并上传全部产物。
#
# 发版操作:
# git tag -a v0.0.1 -m "v0.0.1"
# git push origin v0.0.1
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
# runner 默认镜像无 node,而 checkout/setup-go/release 等 JS 类 action 依赖 node:
# 显式指定含 node 与 git 的镜像;node 已就位则无需 setup-node(npm 直接可用)
container:
image: node:24-bookworm
steps:
# 完整历史:供 git log 生成上一个 tag 以来的变更日志
- name: 检出代码
uses: https://gitea.com/actions/checkout@v4
with:
fetch-depth: 0
- name: 安装 Go(版本取自 go.mod)
uses: https://gitea.com/actions/setup-go@v5
with:
go-version-file: go.mod
- name: 构建前端并嵌入(web/dist → internal/webui/dist)
run: make web sync-assets
- name: 交叉编译发布产物
run: scripts/build-release.sh "${GITEA_REF_NAME}"
# 首个 tag 无上一版本,变更日志段自动省略
- name: 生成发布说明
run: |
prev=$(git describe --tags --abbrev=0 "${GITEA_SHA}^" 2>/dev/null || true)
{
echo "## pn ${GITEA_REF_NAME}"
echo
echo "- commit: \`${GITEA_SHA}\`"
echo "- 构建时间: $(date -u '+%Y-%m-%dT%H:%M:%SZ')"
if [ -n "$prev" ]; then
echo
echo "### 自 ${prev} 以来的变更"
echo
git log --oneline --no-decorate "${prev}..${GITEA_SHA}" | sed 's/^/- /'
fi
} > release-notes.md
cat release-notes.md
- name: 创建 Release 并上传产物
uses: https://gitea.com/actions/release-action@main
with:
files: |-
dist/*
body_path: release-notes.md