發佈到 Gizlet Store
從準備 gizlet.toml、執行 check-project.py、設定 store-channels.yml CI,到發佈開發版與穩定版並以 API 驗證的完整流程。
發佈到 Gizlet Store 全程透過 GitHub Actions 與 OIDC 完成——設定好工作流程後,推送 main 自動發佈開發版,打上 v<version> tag 自動發佈穩定版。
一、準備 gizlet.toml 與商店素材
先確認倉庫根目錄的 gizlet.toml 齊全無誤:
- 必填中繼資料: 反向網域
id、name、不帶-或+後綴的純版本號version(例如0.1.0)、category(game或app),以及各目標平台的[[packages]](只要能在電腦執行,建議同時提供質子 OS、macOS 與 Windows 套件)。 - 商店展示素材: 填妥
description、正方形icon(≥ 256×256)、16:9cover(≥ 1280×720)、screenshots、controls,以及選用的多語言[names]、[descriptions]與[about],零警告通過檢查即可出現在 Explore。 - 私人倉庫: 若原始碼倉庫為私人,請先為該倉庫安裝授權 gizlet-bot GitHub App,Store 才能鏡像 Release 檔案。
推送前先執行 gizlet/skill 的檢查腳本並修完所有錯誤:
python3 path/to/skill/skills/gizlet-dev/scripts/check-project.py .
二、加入 Store CI 工作流程
將 Store CI 範本複製到 .github/workflows/store-ci.yml,並依技術棧調整建置步驟。務必遵守三點:
- checkout 後立刻執行版本 action: 每個打包 job 都要執行
uses: gizlet/.github/.github/actions/version@latest。在 PR 與推送main時,它會把<version>-dev.<run>寫入 runner 上的gizlet.toml(不產生新提交);打v<version>tag 時維持原版本號。./scripts/dev.sh package只需直接讀取gizlet.toml寫入manifest.json與.gzl檔名。 - 將
.gzl上傳至gizlet-packagesartifact 根目錄,再交給共用工作流程gizlet/.github/.github/workflows/store-channels.yml@latest建立 Release 並通知 Store。 - 發佈 job 必須宣告
contents: write與id-token: write,保留範本的concurrency設定,且不要對push觸發器加上paths或paths-ignore。
提醒:推送 .github/workflows/ 檔案需要本機 gh 具備 workflow 權限。
三、發佈開發版與穩定版
- Pull Request
- 只跑測試與打包(
0.1.0-dev.<run>),不發佈。 - 推送到
main - 自動建立
v0.1.0-dev.<run>pre-release,於 Store 的 dev 通道完成索引並在ready後清除舊的v*-dev.*。 - 發佈穩定版
- 在
main對應的提交打上 tag 並推送:
git tag v0.1.0 <commit> && git push origin v0.1.0
穩定版永不自動刪除。發佈 v0.1.0 後,建議開一個 PR 將 gizlet.toml 的 version 升至 0.1.1,讓之後合入 main 產生的 0.1.1-dev.N 在 SemVer 排序上高於 0.1.0。
四、驗證與排錯
用 Store API 確認 tag 狀態為 ready,且目標平台能正常取得安裝位址:
curl -fsS 'https://gizlet.io/api/v1/gizlets/github.com/OWNER/REPO/releases/v0.1.0'
curl -fsS 'https://gizlet.io/api/v1/gizlets/github.com/OWNER/REPO/install?target=aarch64-unknown-linux-gnu&tier=lite'
再開啟 https://gizlet.io/github.com/OWNER/REPO 檢查頁面顯示、截圖與警告訊息。若因暫時性錯誤失敗,可重跑 main 最新的工作流程(穩定版可執行 gh workflow run store-ci.yml --ref v<version>);若是檔案內容有誤,修正後重新推送提交(開發版)或升版再打 tag(穩定版)。
完整欄位與檢查規範請參閱gizlet.toml 欄位參考。