Giter VIP home page Giter VIP logo

publish-vscode-extension's Introduction

Publish VS Code Extension — GitHub Action

Build, Lint, Test and Deploy Coverage Status
License Stars
Donate

GitHub action to publish your VS Code Extension to the Open VSX Registry or the Visual Studio Marketplace.

All breaking changes of v1 are listed in the changelog

Usage

To use the GitHub Action, just reference the action in your workflow file.

Example

The following example shows a workflow that publishes an extension to the Open VSX Registry as well as to the Visual Studio Marketplace when a new tag was created:

on:
  push:
    tags:
      - "*"

name: Deploy Extension
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - name: Publish to Open VSX Registry
        uses: HaaLeo/publish-vscode-extension@v1
        with:
          pat: ${{ secrets.OPEN_VSX_TOKEN }}
      - name: Publish to Visual Studio Marketplace
        uses: HaaLeo/publish-vscode-extension@v1
        with:
          pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
          registryUrl: https://marketplace.visualstudio.com

To package the extension only once and publish the identical .vsix file to both registries one can use the following two steps instead:

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

For a more complete and complex example one can check out the workflow of HaaLeo/vscode-timing.

Open VSX Registry

To publish to the Open VSX Registry ensure that your extension's namespace was created beforehand. You need to set the pat parameter to your Open VSX access token. Further, you should ensure that you only publish an extension which is licensed. For more information regarding Open VSX' timeline and its extensions' licensing check out Brian King's blog (section "Licensing" and "Timeline").

Currently, this GitHub action allows you to publish extensions which do not state their license terms. However, this behavior is deprecated and a future release of this action will reject unlicensed extensions. Therefore, I heavily encourage you to publish an extension with a (permissive) license such as the MIT license.

Visual Studio Marketplace

In order to upload your extension to the VS Marketplace you need to set the pat option to the corresponding access token. Further, the registryUrl must be set to https://marketplace.visualstudio.com.

Input Parameters

You can set any or all of the following input parameters:

Name Type Required? Default Description
pat string yes - The personal access token to the corresponding registry.
extensionFile string no - Path to the vsix file to be published. This option will be preferred when set together with packagePath.
registryUrl string no https://open-vsx.org Use the registry API at this base URL
packagePath string no ./ Path to the extension to be packaged and published. When extensionFile is set too packagePath is ignored.
baseContentUrl string no - Prepend all relative links in README.md with this URL.
baseImagesUrl string no - Prepend all relative image links in README.md with this URL.
yarn boolean no false Use yarn instead of npm while packing extension files.
dryRun boolean no false Set this option to true to package your extension but do not publish it. When using this option set the pat option to a stub value.
noVerify boolean no false Allow publishing extensions to the visual studio marketplace which use a proposed API (enableProposedApi: true). Similar to vsce's --noVerify command line argument.
preRelease boolean no false Mark the extensions release as pre-release. Is only considered when packaging an extension.
dependencies boolean no true Check that dependencies defined in package.json exist in node_modules. Set to false if using pnpm or yarn v2+ with PnP.
skipDuplicate boolean no false Fail silently if version already exists on the marketplace. Equivalent to the --skip-duplicate option of the vsce CLI.
target string no - Target architecture(s) the extension should run on. Separate multiple targets with spaces. E.g.: 'win32-x64 linux-x64'

Outputs

The action exposes the following outputs:

Name Type Description
vsixPath string The path to the packaged and published VSIX file.

Contribution

If you found a bug or are missing a feature do not hesitate to file an issue.
Pull Requests are welcome! To get started submitting code changes please take a look at the CONTRIBUTING.md file first.

Support

When you like this extension make sure to star the repo. I am always looking for new ideas and feedback.
In addition, it is possible to donate via paypal.

publish-vscode-extension's People

Contributors

alexravenna avatar antyos avatar anweber avatar dependabot[bot] avatar gnikit avatar haaleo avatar sdankel avatar vladbrok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

publish-vscode-extension's Issues

add _option_ to publish to GitHub release

Is your feature request related to a problem? Please describe.
Many people don't upload artifacts on GitHub; but as a "manual" and "backup" approach this would be very useful.
If there is a vsix uploaded, then often the vsix was "extra built" (so isn't necessary identical to the uploaded one).

Describe the solution you'd like
Make it easy for users of this action to publish the same vsix which is published to the market places also to GH release.

Describe alternatives you've considered
Setup a separate action that builds the vsix and uploads it, but as most is done nicely here already...

Additional context
This action does it the other way around: build the vsix, upload to GH, then download from there and upload to the market places.

Add support for --target

Is your feature request related to a problem? Please describe.
OpenVSX added support for publishing the extension to specific platforms via --target:
Example:
ovsx ... --target linux-x64

Describe the solution you'd like
Is there any plan to support such an option? Based on my findings is a matter of adding the command here, but I wanted to confirm if this was discussed before or if there is any reason isn't supported.

Describe alternatives you've considered
One alternative is to use ovsx package directly and execute a script from the GitHub Action

Additional context
This was released a while back at eclipse/openvsx#503

Doesn't work with yarn version 2+ with PnP

publish-vscode-extension Version Operating System
1 osx

Description

It fails at yarn list --prod --json, because yarn 2 and 3 don't have yarn list

This is preventing users from being able to upgrade to newer versions of yarn while using this action.

I see this is a problem in the underlying vsce package as well. microsoft/vscode-vsce#517

Expected Behavior

It will need to check the version of yarn and use the appropriate commands for the yarn version. Either that, or change the yarn argument from a boolean to a number or string to represent the version.

Actual Behavior

It fails, example

Steps to Reproduce

  1. Run it on any package that is using yarn version > 1 with PnP

missing published extension

publish-vscode-extension Version Operating System
v1.1.0 Ubuntu 20.04.5 LTS

Description

Hi Leo,

I can't publish my extension to OpenVSX.
I'm not sure if it's an issue with your extension or OpenVSX.

The publishing was successful but the extension is missing on OpenVSX.

##[debug]Evaluating condition for step: 'Publish to Open VSX Registry'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Publish to Open VSX Registry
##[debug]Loading inputs
##[debug]Evaluating: secrets.OPEN_VSX_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'OPEN_VSX_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run HaaLeo/publish-vscode-extension@v1
Specifically, running GitHub Action HaaLeo/[email protected].
##[debug]Start action with options="{"pat":"***","registryUrl":"https://open-vsx.org","packagePath":"./","yarn":false,"dryRun":false,"noVerify":false,"preRelease":false}".
::group::Package the Extension
Package the Extension
::group::Publish the Extension
Publish the Extension
  ::endgroup::
##[debug]Node Action run completed with exit code 0
##[debug]Set output vsixPath = explicit-folding-0.23.0.vsix
##[debug]Finishing: Publish to Open VSX Registry

Is it possible to output the logs of the command?

DeprecationWarning: Buffer() is deprecated due to security and usability issues on publish

publish-vscode-extension Version Operating System
v0 Mac

Description

Getting this error when it's trying to publish to Marketplace

Publish the Extension
  (node:1562) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
  Publishing [email protected]...
Error: Error: Failed request: (401)
    at RestClient.<anonymous> (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v0/dist/index.js:61857:31)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v0/dist/index.js:61661:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Note here is that I'm publishing to open vsx and also a marketplace.
Open VSX works fine but it does not publish to Microsoft marketplace

Expected Behavior

Publish without error

Actual Behavior

Steps to Reproduce

  1. Should be just by trying to use the extensions

Thank you again for an amazing plugin!

Check an extensions license

Description

After eclipse/openvsx#222 is resolved the GitHub action should check whether a license is present by using ovsx's isLicenseOk method. If the license is not ok it should yield a warning.

This is especially usefull when the extension is executed with the dryRun flag.

I am happy to accept a PR on this which includes unit tests as well.

Bump node version

I'm getting deprecation warnings when using this GitHub action:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: HaaLeo/publish-vscode-extension@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

I think it just requires a change to the following line?

using: 'node16'

Workflow fails when snippets package version is already in the registry

publish-vscode-extension Version Operating System
v1 ubuntu-latest

Description

Adding more on this issue.
IMHO the workflow should not error when a package version already exists in the registry.
I have a monorepo with multiple libraries and one snippets package.
Making changes to a library makes the workflow fail since the snippets package wasn't modified, and thus is still on the same version.

Expected Behavior

The workflow should succeed also when the snippets extension is already in the registry.

Actual Behavior

The workflow fails when changing other files in the workspace

image

Steps to Reproduce

Everything is hosted here
Error is thrown here

        if (extension && extension.versions) {
            const sameVersion = extension.versions.filter(v => v.version === manifest.version);
            if (sameVersion.length > 0) {
                if (options.skipDuplicate) {
                    util_2.log.done(`Version ${manifest.version} is already published. Skipping publish.`);
                    return;
                }
                if (sameVersion.some(v => v.targetPlatform === options.target)) {
/* Here */          throw new Error(`${description} already exists.`);
                }
            }
            try {
                await api.updateExtension(undefined, packageStream, manifest.publisher, manifest.name);
            }
            catch (err) {

This code comes from here

Context

Run HaaLeo/publish-vscode-extension@v1
  with:
    packagePath: libs/mintplayer-ng-bootstrap-snippets
    pat: ***
    registryUrl: https://marketplace.visualstudio.com
    yarn: false
    dryRun: false
    noVerify: false
    preRelease: false
    dependencies: true
Specifically, running GitHub Action HaaLeo/[email protected].
Package the Extension
Publish the Extension
Error: Error: MintPlayer.mintplayer-ng-bootstrap-snippets v16.0.1 already exists.
    at _publish (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:5098:[2](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:2)7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async publish (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:50[3](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:3)[7](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:7):13)

provide noVerify input param

I am using this great github action to upload an extension for both openvsx and vsce. In my extension I need the setting enableProposedApi: true because I use the Noteboook Api. However, when publishing, this setting is blocked by vsce and noVerify must be explicitly enabled.
According to vsce#469 this setting is also the suggested solution

The best solution would probably be to be able to directly specify all possible parameters for both ovse and vsce.

- name: Publish to Visual Studio Marketplace
      uses: HaaLeo/publish-vscode-extension@v0
      with:
        pat: ${{ secrets.VSCE_TOKEN }}
        registryUrl: https://marketplace.visualstudio.com
        extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
        vsceOptions: 
            noVerify: true
        openvsxOptions: 
            ...

But if I read the api of @action/core correctly, only string is supported here and implementing the solution seems rather complex.

Packaging fails on "invalid relative path"

publish-vscode-extension Version Operating System
v1 ubuntu-latest

Description

Action fails on packaging my extension because of my editorconfig file?
The invalid relative path it gives me in the error is referenced nowhere in my project. It's just a .editorconfig file at the top level of my monorepo.
I've tried duplicating the .editorconfig file and putting it inside of the folder to be uploaded, but didn't do anything.
Then I assumed it was because I had no vscodeignore file, seems that didn't do anything either.

Expected Behavior

Should not error

Actual Behavior

Errors on "invalid relative path" due to editorconfig (see context)

Steps to Reproduce

  1. Monorepo with packages/xyz-vscode
  2. Have .editorconfig at top level
  3. Try and package ./packages/xyz-vscode to OpenVSX

Context


Error: invalid relative path: extension/../../.editorconfig
at validateMetadataPath (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:109295:59)
at ZipFile.addFile (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:108951:18)
at /home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:4806:19
at Array.forEach ()
at /home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:4802:15
at new Promise ()
at /home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:4800:21
at async pack (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:4870:5)
at async packageCommand (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:4880:36)

The `set-output` command is deprecated and will be disabled soon.

publish-vscode-extension Version Operating System
1.0.7 ubuntu-latest

Description

The set-output command is deprecated and will be disabled soon.

Expected Behavior

No warning message.

Actual Behavior

Warning: The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Steps to Reproduce

  1. Run action

Add pre-release support

Description
VS Code in release 1.63.0 added support for pre-releases and in the future they will be adding semver style tags.
https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_63.md#publishing-pre-release-extensions

It would be a good idea IMO to allow for additional arguments to be passed into vsce, e.g. --pre-release. Of course care needs to be taken with how/when a pre-release build will be triggered. For example, the not so elegant solution that I thought of, is to have a separate .yml with --pre-release set as an argument that runs at every push on master and another .yml that triggers only on a GitHub release.

The important thing is to not allow for a normal release and a pre-release to publish under the exact same version number. There are some tricks that one can employ to ensure that but I would consider this responsibility lying with the developer of the VS Code extension and not this GitHub Action.

Extension manifest not found: node_modules/node_modules/fast-deep-equal/package.json

publish-vscode-extension Version Operating System
@1 and @1.6.0 Linux

Description

Just started seeing Extension manifest not found: node_modules/node_modules/fast-deep-equal/package.json loading the vsix up in VSIX viewer extension and the package.json is definitely there.

I tried updating to 1.6.0 but the running logs(below) still say 1.5.0.

Nothing changed in extension packaging from a build that worked 3 days ago.

Expected Behavior

Build would complete

Actual Behavior

It fails with Extension manifest not found: node_modules/node_modules/fast-deep-equal/package.json

Steps to Reproduce

Context



with:
    pat: ***
    registryUrl: https://marketplace.visualstudio.com
    yarn: true
    preRelease: true
    packagePath: ./
    dryRun: false
    noVerify: false
    dependencies: true
    skipDuplicate: false
Specifically, running GitHub Action HaaLeo/[email protected].
Package the Extension
  Start packaging the extension.
  Executing prepublish script 'yarn run vscode:prepublish'...
  yarn run v1.22.21
  warning [email protected]: The engine "vscode" appears to be invalid.
  $ webpack --mode production
  asset extension.js 8[3](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:3)3 KiB [emitted] [minimized] (name: main) 2 related assets
  asset 713.extension.js [4](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:4).2[5](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:5) KiB [emitted] [minimized] 1 related asset
  orphan modules 55.9 KiB [orphan] 37 modules
  runtime modules 2.44 KiB 8 modules
  modules by path ./node_modules/ 2.1[6](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:6) MiB
    javascript modules 2.15 MiB 43[7](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:7) modules
    json modules 6.63 KiB
      modules by path ./node_modules/ajv/lib/ 3.12 KiB 2 modules
      + 2 modules
  modules by path ./src/ 2[8](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:8)1 KiB 40 modules
  optional modules 126 bytes [optional]
    external "worker_threads" 42 bytes [optional] [built] [code generated]
    external "node:process" 42 bytes [optional] [built] [code generated]
    external "node:stream/web" 42 bytes [optional] [built] [code generated]
  + 21 modules
  webpack 5.8[9](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:9).0 compiled successfully in [13](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:14)717 ms
  Done in [14](https://github.com/launchdarkly/ld-vscode/actions/runs/7755698217/job/21151596703#step:11:15).38s.
Error: Extension manifest not found: node_modules/node_modules/fast-deep-equal/package.json

Failed request: 401 on Publishing Extension

publish-vscode-extension Version Operating System
v1.0.7 Windows

Description

The extension fails on publishing the extension on the visual studio marketplace.

Expected Behavior

The extension should publish the .vsix file to Visual Studio Marketplace

Actual Behavior

It fails on Publish to Visual Studio Marketplace step. Packaging the extension was successful but publishing isn't.

Steps to Reproduce

Could be reproduced by forking https://github.com/stephenasuncionDEV/gencomp

Context

Notable Changes:

  • Instead of npm ci, I did yarn install
  • VS_ACCESS_TOKEN secret has all the scope

Action:


name: CI to VS Marketplace
on:
  push:
    branches: [ main ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Check Out Repo 
        uses: actions/checkout@v2
  - name: Setup Node.js
    uses: actions/setup-node@v1
    with:
      node-version: 16

  - name: Install Dependencies
    run: yarn install

  - name: Publish to Visual Studio Marketplace
    uses: HaaLeo/[email protected]
    with:
      pat: ${{ secrets.VS_ACCESS_TOKEN }}
      registryUrl: https://marketplace.visualstudio.com

Error:
image

Incomplete extension with v0.4.1

Error: Failed request: (401) on publish extension

I'm getting the following error when I try to publish my extension to VSCE:

Run HaaLeo/publish-vscode-extension@v1
[2](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:2)
  with:
[3](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:3)
    pat: ***
[4](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:4)
    registryUrl: https://marketplace.visualstudio.com/
[5](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:5)
    packagePath: ./
[6](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:6)
    yarn: false
[7](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:7)
    dryRun: false
[8](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:8)
    noVerify: false
[9](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:9)
    preRelease: false
[10](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:10)
  env:
[11](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:11)
    pythonLocation: /opt/hostedtoolcache/Python/3.10.4/x64
[12](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:12)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.4/x64/lib
[13](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:13)
Specifically, running GitHub Action HaaLeo/[email protected].
[14](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:14)
Package the Extension
[15](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:15)
  Start packaging the extension.
[16](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:16)
   DONE  Packaged: cloudformation-yaml-snippets-3.58.0.vsix (19 files, 9.39MB)
[17](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:17)

[18](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:18)
Publish the Extension
[19](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:19)
  (node:2560) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[20](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:20)
  (Use `node --trace-deprecation ...` to show where the warning was created)
[21](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:21)
   INFO  Publishing 'dannysteenman.cloudformation-yaml-snippets v3.58.0'...
[22](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:22)
Error: Error: Failed request: (401)
[23](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:23)
    at RestClient.<anonymous> (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:101043:31)
[24](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:24)
    at Generator.next (<anonymous>)
[25](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:25)
    at fulfilled (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:100847:58)
[26](https://github.com/dannysteenman/vscode-cloudformation-snippets/runs/6128051575?check_suite_focus=true#step:8:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

This is the how I configured the step in my github workflow:

      - name: Publish to Visual Studio Marketplace
        uses: HaaLeo/publish-vscode-extension@v1
        id: publishToVSCE
        with:
          pat: ${{ secrets.VSCE_TOKEN }}
          registryUrl: https://marketplace.visualstudio.com

Using extensionFile option throws error

Your documentation is thorough and excellent. I'm new to gh actions though so pardon me..

I'm writing a workflow to publish rust-analyzer to open-vsix.org. The repo is here. I have a step to query github for the latest release and download the vsix file. It is successful. However, I'm having trouble passing it to the next step (yours, the publishing step). I'm getting Error: Please specify either an extension file or a package path, but not both. I have not specified both keys.

I understand you are under no obligation to help me, you published this action out of the goodness of your heart! Just close this issue then, I get it.

open vsx publish errors are silently "swallowed" and not shown to the user

publish-vscode-extension Version Operating System
v1 lubuntu linux

Description

open vsx publish errors are silently "swallowed" and not shown to the user
this happens because of the "allSettled" used here https://github.com/eclipse/openvsx/blob/master/cli/src/publish.ts (line 29)
more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled

Expected Behavior

All errors are shown to the user

Actual Behavior

open vsx publish errors are silently "swallowed" and not shown to the user

Steps to Reproduce

  1. try to publish an extension to open vsx, but make an error intentionally, for example, specify a .vsix file that does not exist:
      - name: Publish to Open VSX Registry
        uses: HaaLeo/publish-vscode-extension@v1
        with:
          pat: ${{ secrets.OPEN_VSX_TOKEN }}
          extensionFile: package.vsix #package.vsix does not exist
  1. run CI
  2. "publish the extension" section in the CI result will be empty:
    image
    and extension is not published due to an error.

Context



NPM lockfile error

Description

Followed the steps to set it up but I get this error when trying to run

The `npm ci` command can only install with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate a package-lock.json file, then try again.

I'm unfamiliar with npm and github actions, so I'm sure I must have missed a step in how to configure this.

Upgrade vsce version

Would it be possible to bump the vsce version? There are new features available in 2.9.1 that our project requires

Thank you!

Invalid extension name

publish-vscode-extension Version Operating System
v1.2.0 ubuntu-latest

Description

I get this error.
image

I don’t understand what is wrong with the extension name because I use lots of extensions that have this name pattern.

Here is my repo where you can check the action.

Failed request (401)

Thank you for making this GitHub action.

I keep getting Error: Failed request: (401), but I am sure that my PAT is correct and has correct permissions. Is there a way of debugging this request?

Question: how to workaround or fix Error: package@version already exists. Version number cannot be the same.

Hi!

I have a couple of questions about how to use this action. I'm getting this issue because my repo already has a package.json that specifies a version number:

image

I was expecting the action to automagically bump the version at package.json with my new release tag and pushing a commit with that change to my repo. What is the right way to do it?

Sorry if it's a newbie question. This is the first GH Action I'm using and I'm not a hardcore VS Extension developer neither 😅

P.S: I also got this error because the npm ci command was missing a package-lock.json file. I don't have one, so I removed it. I guess it is fine, right?

image

For reference, this is the repo I'm trying to use this action at: https://github.com/Maximetinu/Sublime-Text-Monokai-theme-for-Visual-Studio-Code

`Error: Input required and not supplied: pat`

While using this action with the following yml file:

on:
  push:
    branches: [ main ]

name: Deploy Extension
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - run: npm ci
      - name: Publish to Open VSX Registry
        uses: HaaLeo/publish-vscode-extension@v0
        id: publishToOpenVSX
        with:
          pat: ${{ secrets.OPEN_VSX }}
      - name: Publish to Visual Studio Marketplace
        uses: HaaLeo/publish-vscode-extension@v0
        with:
          pat: ${{ secrets.VSC_MARKETPLACE }}
          registryUrl: https://marketplace.visualstudio.com
          extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
          packagePath: ''

I'm getting the error in the title of this issue. I found a workaround, which is to set the INPUT_PAT environment variables explicitly (together with the 'with.pat' option) like this:

on:
  push:
    branches: [ main ]

name: Deploy Extension
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - run: npm ci
      - name: Publish to Open VSX Registry
        uses: HaaLeo/publish-vscode-extension@v0
        id: publishToOpenVSX
        env:
          INPUT_PAT: ${{ secrets.OPEN_VSX }}
        with:
          pat: ${{ secrets.OPEN_VSX }}
      - name: Publish to Visual Studio Marketplace
        uses: HaaLeo/publish-vscode-extension@v0
        env:
          INPUT_PAT: ${{ secrets.VSC_MARKETPLACE }}
        with:
          pat: ${{ secrets.VSC_MARKETPLACE }}
          registryUrl: https://marketplace.visualstudio.com
          extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
          packagePath: ''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.