Skip to content

Commit b6a606f

Browse files
Support manual release dispatch and auto-generated notes
- workflow_dispatch now takes a `tag` input: fill it in the Actions UI to create the tag and publish a real release; leave it empty to only build and upload an artifact for validation - Publish step now sets generate_release_notes so releases get an auto-generated changelog since the previous tag, plus a prerelease toggle Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 03b1de2 commit b6a606f

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
name: Release
22

3-
# 推送 v* tag 時自動 build 並發佈 release;也可在 Actions 分頁手動觸發驗證建置
3+
# 兩種發佈方式:
4+
# 1. 命令列推 v* tag: git tag v1.4 && git push origin v1.4
5+
# 2. Actions 分頁手動:Run workflow → 在「tag」欄填 v1.4
6+
# tag 欄留空時只建置+上傳 artifact 驗證,不會發 release。
47
on:
58
push:
69
tags: ['v*']
710
workflow_dispatch:
11+
inputs:
12+
tag:
13+
description: '要發佈的版本 tag(例如 v1.4)。留空=只建置驗證、不發 release。'
14+
required: false
15+
default: ''
16+
prerelease:
17+
description: '標記為 pre-release'
18+
type: boolean
19+
default: false
820

921
permissions:
1022
contents: write
@@ -25,14 +37,18 @@ jobs:
2537
- name: Build exe
2638
run: pyinstaller --noconfirm --onefile --windowed --name KKCardsClassifier KKCardsClassifier.py
2739

28-
- name: Upload build artifact (for validation runs)
40+
- name: Upload build artifact (validation runs)
2941
uses: actions/upload-artifact@v4
3042
with:
3143
name: KKCardsClassifier-exe
3244
path: dist/KKCardsClassifier.exe
3345

34-
- name: Attach to release (tag pushes only)
35-
if: startsWith(github.ref, 'refs/tags/')
46+
- name: Publish release
47+
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != ''
3648
uses: softprops/action-gh-release@v2
3749
with:
50+
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
51+
name: KKCardsClassifier ${{ github.event.inputs.tag || github.ref_name }}
52+
generate_release_notes: true
53+
prerelease: ${{ github.event.inputs.prerelease == 'true' }}
3854
files: dist/KKCardsClassifier.exe

0 commit comments

Comments
 (0)