develop
master
重構 Gitea Actions 的 CI 與 master 兩條工作流程,改以 gitea release 與 commit tag 管理版本與發佈。
.gitea/workflows/ci.yaml
.gitea/workflows/master.yaml
branches-ignore: master
build
VERSION: 0.0.0-beta.${{ gitea.run_number }}
gitea-release-action
base_ref == 'develop'
test
message
MESSAGE == ''
result
needs.build
needs.test
deploy
fetch-depth: 0
git describe --contains
gitea.event.commits[1].id
No dependencies set.
The note is not visible to the blocked user.
變更摘要
重構 Gitea Actions 的 CI 與 master 兩條工作流程,改以 gitea release 與 commit tag 管理版本與發佈。
影響範圍
.gitea/workflows/ci.yaml(PR 觸發的 CI 流程).gitea/workflows/master.yaml(推送 master 觸發的部署流程)重點變更
ci.yaml
branches-ignore: master條件,PR 事件不再排除 master。buildjob 改為負責發佈 release:新增VERSION: 0.0.0-beta.${{ gitea.run_number }},以gitea-release-action建立 release 與 tag,並依base_ref == 'develop'判斷是否為 prerelease。testjob(needs: build),承接原本的 codex 執行與message輸出;步驟更名為 Source Code Checkout / Run Setup Codex / Execute Codex。MESSAGE == ''判斷失敗的 Test 步驟。resultjob 的message來源由needs.build改為needs.test,步驟更名為 Show Message。master.yaml
build/ Calculate Version job。deployjob 改為 checkout(fetch-depth: 0)後,以git describe --contains取得 commit tag 並輸出顯示。風險與注意事項
gitea.event.commits[1].id取得 commit SHA,請確認推送事件的 commit 索引與git describe --contains能正確解析出 tag。