Skip to content

release: 讓發行流程可手動觸發並自行建立 tag - #6

Merged
nojackno2-ctrl merged 1 commit into
mainfrom
claude/memory-cpu-optimization-p0z5ve
Aug 4, 2026
Merged

release: 讓發行流程可手動觸發並自行建立 tag#6
nojackno2-ctrl merged 1 commit into
mainfrom
claude/memory-cpu-optimization-p0z5ve

Conversation

@nojackno2-ctrl

Copy link
Copy Markdown
Owner

為什麼

原本的 release workflow 只吃 v* tag 推送。這有兩個問題:

  1. 不是每個開發環境都能推送 refs/tags。這個工作階段的 git proxy 就直接回 403,tag 打不上去,發行流程等於卡死。
  2. tag 推送是一次性觸發。發行途中失敗(Inno Setup 裝不起來、publish 逾時),就沒辦法在不換版號的情況下重試。

改了什麼

workflow_dispatch 新增,把 tag 當作輸入;手動執行時由 workflow 自己針對建置當下的 commit 建立 taggh release create --target <sha>),tag 推送的路徑則維持 --verify-tag 不變。

兩道額外保護:

  • 輸入經由環境變數傳遞,不直接插進 PowerShell 腳本內容,因此無法注入指令;而且必須先通過版本 tag 的格式檢查才會往下跑。
  • 同版號已存在就拒絕執行。否則要嘛在最後一步才失敗,要嘛覆蓋掉別人已經下載過的檔案。

原有的四道保護(版號一致性、三個檔案齊全、發行說明來自 repo、預發行標記不寫死)都保留。

🤖 Generated with Claude Code

https://claude.ai/code/session_01KqeMPekXsH3e1tSgJkWYyz


Generated by Claude Code

Pushing to refs/tags is not available from every environment the project is
worked on from, and a tag push is also a one-shot trigger: a release that
fails halfway through cannot be retried without inventing a new version
number. The workflow now also accepts a manual run with the tag as an input,
and creates that tag itself against the exact commit it built.

The input is passed through the environment rather than interpolated into
the script body, so it cannot inject PowerShell, and it must look like a
version tag before anything else runs.

Also refuses to run when a release for the tag already exists, which would
otherwise either fail late or replace files people have downloaded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KqeMPekXsH3e1tSgJkWYyz
@nojackno2-ctrl
nojackno2-ctrl merged commit fcef575 into main Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants