diff --git a/.github/workflows/typescript/publish-to-vscode.yml b/.github/workflows/typescript/publish-to-vscode.yml index 329f00c..0f41622 100644 --- a/.github/workflows/typescript/publish-to-vscode.yml +++ b/.github/workflows/typescript/publish-to-vscode.yml @@ -18,9 +18,16 @@ on: required: false type: string default: "" + registries: + description: "Comma-separated list of registries to publish to. Valid values: 'open-vsx', 'vscode-marketplace'. Default: both." + required: false + type: string + default: "open-vsx,vscode-marketplace" secrets: OPEN_VSX_TOKEN: required: false + VSCE_PAT: + required: false jobs: publish: @@ -56,12 +63,22 @@ jobs: run: echo "path=$(find . -maxdepth 1 -name '*.vsix' | head -1)" >> "$GITHUB_OUTPUT" - name: Publish to Open VSX Registry + if: ${{ contains(inputs.registries, 'open-vsx') }} uses: HaaLeo/publish-vscode-extension@v2 with: pat: ${{ secrets.OPEN_VSX_TOKEN }} extensionFile: ${{ steps.vsix.outputs.path }} dryRun: ${{ inputs.dry-run }} + - name: Publish to VS Code Marketplace + if: ${{ contains(inputs.registries, 'vscode-marketplace') }} + uses: HaaLeo/publish-vscode-extension@v2 + with: + pat: ${{ secrets.VSCE_PAT }} + registryUrl: https://marketplace.visualstudio.com + extensionFile: ${{ steps.vsix.outputs.path }} + dryRun: ${{ inputs.dry-run }} + - name: Upload VSIX to GitHub Release if: ${{ !inputs.dry-run && github.event_name == 'release' }} run: gh release upload "${{ github.ref_name }}" "${{ steps.vsix.outputs.path }}"