Skip to content

Commit 8a27f22

Browse files
committed
ci: auto-release each master commit
1 parent 0947644 commit 8a27f22

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010
inputs:
1111
version:
12-
description: 'Stable release version to publish, e.g. v1.3.6. Leave empty for nightly from master.'
12+
description: 'Stable release version to publish, e.g. v1.3.6. Leave empty to auto-bump the latest patch version.'
1313
required: false
1414
type: string
1515
default: ''
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Resolve release version
2830
id: release-version
@@ -33,6 +35,16 @@ jobs:
3335
tag="${GITHUB_REF_NAME}"
3436
elif [[ -n "${INPUT_VERSION}" ]]; then
3537
tag="${INPUT_VERSION}"
38+
elif [[ "${GITHUB_REF}" == refs/heads/master ]]; then
39+
latest="$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n 1)"
40+
if [[ -z "${latest}" ]]; then
41+
tag="v1.0.0"
42+
elif [[ "${latest}" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
43+
tag="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.$((BASH_REMATCH[3] + 1))"
44+
else
45+
echo "Could not parse latest release tag: ${latest}" >&2
46+
exit 1
47+
fi
3648
else
3749
tag=""
3850
fi
@@ -70,6 +82,17 @@ jobs:
7082
env:
7183
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7284

85+
- name: Create Auto Tagged Release
86+
if: github.ref == 'refs/heads/master' && steps.release-version.outputs.tag != ''
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
tag_name: ${{ steps.release-version.outputs.tag }}
90+
target_commitish: ${{ github.sha }}
91+
files: harmony-next.skill
92+
generate_release_notes: true
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
7396
- name: Create Tagged Release
7497
if: startsWith(github.ref, 'refs/tags/v')
7598
uses: softprops/action-gh-release@v2

docs-linhay/dev/2026-05-19-skill-doc-ai-readiness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
- 新增 `harmony-next/scripts/sync_release_version.py` 作为版本同步单一执行入口。
4646
- GitHub Actions 发布流程在打包前解析 tag 或 `workflow_dispatch.inputs.version`,自动同步 `SKILL.md``metadata.version`、正文版本、隐藏版本,以及中英文 README 的 release badge/link。
4747
- 发布前固定运行 `python3 -m unittest discover -s harmony-next/tests -p 'test_*.py' -v`,避免版本元信息不同步时继续生成 `.skill` 产物。
48-
- `master` 自动发布 nightly 时不强行改稳定版本;tag 发布和手动指定版本发布会按目标版本重写打包工作区内的元信息。
48+
- `master` 每次 push 默认读取最新 `vX.Y.Z` tag 并自动递增 patch 版本发稳定 release;tag 发布和手动指定版本发布会按目标版本重写打包工作区内的元信息。
4949

5050
## Subagent 体验反馈修正
5151

docs-linhay/memory/2026-05-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
- 明确 `references/` 是 HarmonyOS API 12-23 的离线快照,不等同于在线实时文档;遇到 latest/current、新 API 或在线文档一致性问题时,需要对比 GitHub Releases、nightly 包和华为在线文档。
2525
-`SKILL.md` 中补充 Gemini CLI、Claude.ai / Claude Code、Codex 的安装或更新入口,并新增 `test_skill_metadata.py` 防止后续版本/安装信息缺失。
2626
- 进一步按渐进式披露优化:版本进入 frontmatter `metadata.version`,正文章节收敛为 `Version`,仅保留 Agent 决策所需的最小安装入口。
27-
- 新增 `sync_release_version.py` 并接入 GitHub Actions:tag 发布或手动指定版本发布时,CI 会在打包前同步 `SKILL.md` 与中英文 README 的版本信息,并先跑 unittest;nightly 不改稳定版本
27+
- 新增 `sync_release_version.py` 并接入 GitHub Actions:tag 发布、手动指定版本发布或 `master` 每次 push 自动递增 patch 版本时,CI 会在打包前同步 `SKILL.md` 与中英文 README 的版本信息,并先跑 unittest。

0 commit comments

Comments
 (0)