publish-vscode-extension icon indicating copy to clipboard operation
publish-vscode-extension copied to clipboard

Can't set target if VSIX already exists, and file name isn't set correctly.

Open ajbt200128 opened this issue 1 year ago • 0 comments

publish-vscode-extension Version Operating System
1.6.2 linux-x64, linux-arm64, darwin-x64, darwin-arm64

Description

If we try and publish to multiple places, with a set target:

- name: Publish to Open VSX Registry
  uses: HaaLeo/publish-vscode-extension@v1
  id: publishToOpenVSX
  with:
    pat: ${{ secrets.OPEN_VSX_TOKEN }}
    target: ${{matrix.os}}
- name: Publish to Visual Studio Marketplace
  uses: HaaLeo/publish-vscode-extension@v1
  with:
    pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
    registryUrl: https://marketplace.visualstudio.com
    target: ${{matrix.os}}
    extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}

we get

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.

on the second action. If we remove the extensionFile field, it still produces this error.

If we remove the target field, it turns out the vsixPath output of the first action will extensionname-X.X.X.vsix, even though target is set. This means the second action will upload it as universal.

Expected Behavior

We should either be able to set target on both actions, or when the action produces a vsix with a specific target, it should name it according to how vsce package names it, so it gets uploaded correctly in the second action, i.e. extensionname-platform-X.X.X.vsix

Actual Behavior

See description

Steps to Reproduce

  1. Create an action as mentioned in description
  2. run it
  3. try removing the target or extension file field from the 2nd invocation of the action

Context



ajbt200128 avatar Sep 05 '24 19:09 ajbt200128