Release #1
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
| name: Release | |
| # 推送 v* tag 時自動 build 並發佈 release;也可在 Actions 分頁手動觸發驗證建置 | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install pyinstaller tkinterdnd2 | |
| - name: Build desktop exe | |
| run: pyinstaller --noconfirm --onefile --windowed --name timeline_detector --additional-hooks-dir . exe_ver/timeline_detector.py | |
| - name: Upload build artifact (for validation runs) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: timeline_detector-exe | |
| path: dist/timeline_detector.exe | |
| - name: Attach to release (tag pushes only) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/timeline_detector.exe |