Commit 6b4696c
authored
fix(publish): drop --target from vsce publish (conflicts with --packagePath) (#27)
## Why
After #26 surfaced vsce's actual error (which the bash retry function
was previously eating), the diagnostic was clear. Reproduced locally by
downloading the failed run's `vsix-darwin-x64` artifact and running:
```
$ npx @vscode/vsce@^3 publish --target darwin-x64 --packagePath extension-darwin-x64.vsix --pat <fake>
ERROR Both options not supported simultaneously: 'packagePath' and 'target'.
Use 'vsce package --target <target>' to first create a platform specific
package, then use 'vsce publish --packagePath <path>' to publish it.
```
vsce reads the target from the `.vsix` manifest's `<TargetPlatform>` tag
(stamped at `vsce package --target` time) and explicitly rejects
`--target` together with `--packagePath`. The error fires before any
auth check, which is why all 4 vsce publishes failed in ~1 second flat.
ovsx is more permissive and accepts both flags together — that's why
every ovsx publish succeeded while every vsce publish failed
identically.
## Fix
Drop `--target ${{ matrix.target }}` from the `vsce publish` call. The
matrix still records the target via the step name, the artifact name,
the .vsix filename, and the manifest stamping — nothing self-documenting
is lost.
`ovsx publish --target ... --packagePath ...` is left as-is since ovsx
accepts both and the explicit `--target` round-trips through the ovsx
API for the registry's own metadata (and worked on the previous run for
all 4 targets).
## State going in
- **VS Code Marketplace:** still on `0.2.0`. `0.2.2` never landed.
- **Open VSX:** has `0.2.2` for all 4 targets.
- **#26 merged:** retry function now surfaces vsce/ovsx output
regardless of exit code.
## Recovery on merge
`prepare` will see Marketplace doesn't have `0.2.2` → proceeds. ovsx
will return "already exists" for all 4 targets → idempotent success.
vsce, with the conflicting flag removed, should publish all 4 targets
cleanly. `finalize` will tag and cut the GitHub Release.
## Test plan
- [x] Reproduced the error locally with the failed-run artifact
- [x] Confirmed `vsce publish --packagePath <vsix>` (without `--target`)
is the documented vsce form for publishing pre-packaged
platform-specific .vsix files
- [ ] After merge: push to main triggers re-run; vsce publishes all 4
targets to Marketplace; finalize creates `vscode-extension-v0.2.2` tag
and GitHub Release1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
282 | 286 | | |
283 | | - | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
| |||
0 commit comments