Skip to content

Commit 03b1de2

Browse files
Add GitHub Actions release workflow
Build the distributable on every v* tag push (and on manual dispatch for validation) and attach it to the GitHub Release for that tag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 27a13db commit 03b1de2

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
# 推送 v* tag 時自動 build 並發佈 release;也可在 Actions 分頁手動觸發驗證建置
4+
on:
5+
push:
6+
tags: ['v*']
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.11'
21+
22+
- name: Install PyInstaller
23+
run: pip install pyinstaller
24+
25+
- name: Build exe
26+
run: pyinstaller --noconfirm --onefile --windowed --name KKCardsClassifier KKCardsClassifier.py
27+
28+
- name: Upload build artifact (for validation runs)
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: KKCardsClassifier-exe
32+
path: dist/KKCardsClassifier.exe
33+
34+
- name: Attach to release (tag pushes only)
35+
if: startsWith(github.ref, 'refs/tags/')
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
files: dist/KKCardsClassifier.exe

0 commit comments

Comments
 (0)