|
| 1 | +# Marketplace Publish Setup |
| 2 | + |
| 3 | +This fork publishes the VS Code extension as: |
| 4 | + |
| 5 | +- **Publisher:** `ZooCodeOrganization` |
| 6 | +- **Extension name:** `zoo-code` |
| 7 | +- **Item:** `ZooCodeOrganization.zoo-code` |
| 8 | + |
| 9 | +## Why the pre-release deploy failed |
| 10 | + |
| 11 | +Failed run (example): [Publish Pre-release Extension #1](https://github.com/hacker-b2k/Zoo-Code/actions/runs/29723609703) |
| 12 | + |
| 13 | +Evidence from that run: |
| 14 | + |
| 15 | +1. Checkout / install / build / package / VSIX validation: **success** |
| 16 | +2. Publish step: **failure** |
| 17 | +3. Exact Azure Marketplace error: |
| 18 | + |
| 19 | +```text |
| 20 | +The Personal Access Token verification has failed. |
| 21 | +Additional information: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' |
| 22 | +is not authorized to access this resource. |
| 23 | +``` |
| 24 | + |
| 25 | +That dummy GUID almost always means: |
| 26 | + |
| 27 | +- `VSCE_PAT` secret is missing, empty, expired, or |
| 28 | +- the PAT is valid for a different publisher / Azure org and cannot publish as `ZooCodeOrganization`. |
| 29 | + |
| 30 | +## Secrets required |
| 31 | + |
| 32 | +### Environment: `marketplace-prerelease` (pre-release) |
| 33 | + |
| 34 | +| Secret | Required | Purpose | |
| 35 | +| ----------------- | -------- | ----------------------------------------------- | |
| 36 | +| `VSCE_PAT` | **Yes** | Azure DevOps PAT with **Marketplace → Publish** | |
| 37 | +| `POSTHOG_API_KEY` | Optional | Telemetry key baked into package | |
| 38 | + |
| 39 | +### Environment: `marketplace-production` (stable) |
| 40 | + |
| 41 | +| Secret | Required | Purpose | |
| 42 | +| ----------------- | ---------------- | ---------------------- | |
| 43 | +| `VSCE_PAT` | **Yes** | Same as above | |
| 44 | +| `OVSX_PAT` | Yes for Open VSX | Open VSX publish token | |
| 45 | +| `POSTHOG_API_KEY` | Optional | Telemetry key | |
| 46 | + |
| 47 | +## Create a correct VSCE_PAT |
| 48 | + |
| 49 | +1. Sign in to Azure DevOps as the account that owns / can publish for **ZooCodeOrganization**. |
| 50 | +2. User settings → Personal access tokens → New token. |
| 51 | +3. Organization: the Azure org linked to the VS Marketplace publisher. |
| 52 | +4. Scopes: **Marketplace → Manage** (or at least **Publish**). |
| 53 | +5. Create token and copy it once. |
| 54 | + |
| 55 | +## Install the secret on this GitHub repo |
| 56 | + |
| 57 | +GitHub → `hacker-b2k/Zoo-Code` → **Settings** → **Environments** → **marketplace-prerelease** |
| 58 | + |
| 59 | +Add secret: |
| 60 | + |
| 61 | +```text |
| 62 | +Name: VSCE_PAT |
| 63 | +Value: <the Azure DevOps PAT> |
| 64 | +``` |
| 65 | + |
| 66 | +Also add the same secret under **marketplace-production** if you publish stable releases. |
| 67 | + |
| 68 | +Repository-level secret with the same name also works if the environment is configured to inherit it, but environment secret is preferred. |
| 69 | + |
| 70 | +## Publish pre-release (after secret is set) |
| 71 | + |
| 72 | +Pre-release is **manual** so ordinary `main` baseline syncs do not create failed deployments. |
| 73 | + |
| 74 | +1. Ensure `main` has the code you want to publish. |
| 75 | +2. GitHub → **Actions** → **Publish Pre-release Extension** |
| 76 | +3. **Run workflow** → branch **main** |
| 77 | +4. Confirm green deployment under **Deployments → marketplace-prerelease** |
| 78 | + |
| 79 | +## Verify locally (optional) |
| 80 | + |
| 81 | +```bash |
| 82 | +# package only (no publish) |
| 83 | +pnpm --filter @roo-code/build build |
| 84 | +pnpm --filter @roo-code/vscode-webview build |
| 85 | +pnpm --filter ./src exec vsce package --pre-release --no-dependencies --out ../bin |
| 86 | + |
| 87 | +# publish only if you have a real PAT in your shell |
| 88 | +export VSCE_PAT=... # never commit this |
| 89 | +npx @vscode/vsce publish --pre-release --packagePath bin/zoo-code-<version>.vsix |
| 90 | +``` |
| 91 | + |
| 92 | +## Important |
| 93 | + |
| 94 | +- A GitHub token is **not** a `VSCE_PAT`. |
| 95 | +- The PAT must be allowed to publish as **`ZooCodeOrganization`**. |
| 96 | +- If you do not control that publisher, either get access or change publisher identity via a deliberate product decision (not done by this fix). |
0 commit comments