release: 讓發行流程可手動觸發並自行建立 tag - #6
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
為什麼
原本的 release workflow 只吃
v*tag 推送。這有兩個問題:refs/tags。這個工作階段的 git proxy 就直接回 403,tag 打不上去,發行流程等於卡死。改了什麼
workflow_dispatch新增,把 tag 當作輸入;手動執行時由 workflow 自己針對建置當下的 commit 建立 tag(gh release create --target <sha>),tag 推送的路徑則維持--verify-tag不變。兩道額外保護:
原有的四道保護(版號一致性、三個檔案齊全、發行說明來自 repo、預發行標記不寫死)都保留。
🤖 Generated with Claude Code
https://claude.ai/code/session_01KqeMPekXsH3e1tSgJkWYyz
Generated by Claude Code