---
title: "發佈到 Gizlet Store"
summary: "從準備 gizlet.toml、執行 check-project.py、設定 store-channels.yml CI，到發佈開發版與穩定版並以 API 驗證的完整流程。"
category: developers
tags: ["release","ci","store"]
language: zh-TW
published: 2026-12-06
updated: 2026-12-06
url: https://gizlet.io/blog/publish-to-store
---

發佈到 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:9 `cover`（≥ 1280×720）、`screenshots`、`controls`，以及選用的多語言 `[names]`、`[descriptions]` 與 `[about]`，零警告通過檢查即可出現在 [Explore](https://gizlet.io/explore)。
- **私人倉庫：** 若原始碼倉庫為私人，請先為該倉庫安裝授權 [gizlet-bot GitHub App](https://github.com/apps/gizlet-bot)，Store 才能鏡像 Release 檔案。

推送前先執行 [gizlet/skill](https://github.com/gizlet/skill) 的檢查腳本並修完所有錯誤：

```sh
python3 path/to/skill/skills/gizlet-dev/scripts/check-project.py .
```

# 二、加入 Store CI 工作流程

將 [Store CI 範本](https://github.com/gizlet/skill/blob/main/skills/gizlet-dev/assets/store-ci.yml)複製到 `.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-packages` artifact 根目錄**，再交給共用工作流程 `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 並推送：

```sh
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`，且目標平台能正常取得安裝位址：

```sh
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 欄位參考](https://gizlet.io/blog/agent-gizlet-toml)。
