打包與釋出

釋出相關檔案

  • .github/workflows/build.yml:監聽 v* tag,執行測試、同步更新檔案、打包並建立 GitHub Release。
  • pyappify.yml:定義應用名稱、入口、圖示、Python 版本和更新倉庫。
  • pyproject.toml:定義 Qt、Web 和文件依賴 profile。
  • requirements.txt、requirements-web.txt:由 TOML profile 編譯的安裝鎖定檔案。
  • deploy.txt:定義同步到獨立更新倉庫的檔案。
  • .github/workflows/mirrorchyan_*.yml:可選的 Mirror醬上傳和更新日誌工作流。

修改構建工作流

首次釋出前,根據自己的專案修改 .github/workflows/build.yml:

  • 更新 Git 使用者資訊。
  • 更新原始碼庫和更新庫地址。
  • 更新安裝包名稱和 Release 下載連結。
  • 配置工作流需要的 GitHub Actions Secrets。
  • 刪除不使用的 CNB、網盤或其他模板專用內容。

Mirror醬

接入 Mirror醬

保留並修改:

  • .github/workflows/mirrorchyan_uploading.yml
  • .github/workflows/mirrorchyan_release_note.yml

更新其中的 owner、repo、mirrorchyan_rid 和安裝包檔名,保留 build.yml 中觸發這兩個工作流的步驟,並配置 MirrorChyanUploadToken。

不接入 Mirror醬

刪除兩個 MirrorChyan workflow 檔案,並刪除 build.yml 中的 Trigger MirrorChyanUploading 步驟。

推送版本 tag

提交併推送初始化結果,再建立符合 v* 規則的 tag:

git add .
git commit -m "Initialize project"
git push origin HEAD
git tag v0.1.0
git push origin v0.1.0

GitHub Actions 會執行測試、打包 EXE,並建立對應的 GitHub Release。釋出前再次搜尋 .github/workflows,確認沒有遺留的模板倉庫地址、專案名或未配置的 Secrets。

修改依賴後,使用專案虛擬環境重新編譯鎖定檔案:

python -m piptools compile --extra qt --strip-extras --no-header --output-file requirements.txt pyproject.toml
python -m piptools compile --extra web --strip-extras --no-header --output-file requirements-web.txt pyproject.toml
python -m piptools compile --extra docs --strip-extras --no-header --output-file requirements-docs.txt pyproject.toml

Qt 鎖定檔案使用 --no-deps 安裝。編譯完成後,刪除生成的 pyside6 和 pyside6-addons 條目,但保留 pyside6-essentials,避免 Fluent Widgets 重新引入未使用的完整 PySide6 元件。

在 GitHub 查看來源 ↗ · 頁面產生時間: 2026年9月24日