Skip to content

Commit 6b4696c

Browse files
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 Release
2 parents 177712f + c9ce21c commit 6b4696c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,13 @@ jobs:
277277
done
278278
}
279279
280-
# `--target` is read from the .vsix manifest (set at package time),
281-
# but pass it explicitly to make the matrix entry self-documenting.
280+
# vsce reads the target from the .vsix manifest (set at package
281+
# time) and explicitly rejects `--target` together with
282+
# `--packagePath` — quote: "Both options not supported
283+
# simultaneously: 'packagePath' and 'target'." So pass only
284+
# `--packagePath`. The matrix already records the target visibly
285+
# in the step name and artifact name.
282286
retry_publish npx --yes @vscode/vsce@^3 publish \
283-
--target ${{ matrix.target }} \
284287
--packagePath extension-${{ matrix.target }}.vsix \
285288
--azure-credential
286289

0 commit comments

Comments
 (0)