New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

semantic-release-vsce

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-release-vsce

semantic-release plugin to package and publish VS Code extensions

  • 5.0.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
718
decreased by-51.81%
Maintainers
2
Weekly downloads
 
Created
Source

semantic-release-vsce

semantic-release plugin to package and publish VS Code extensions.

npm downloads ci dependencies peerDependencies semantic-release

StepDescription
verifyVerify the presence and the validity of the authentication (set via environment variables) and the package.json
prepareGenerate the .vsix file using vsce, this can be be controlled by providing packageVsix in config.
Note:- If the OVSX_PAT env variable is set, this step will still run
publishPublish the extension

Install

npm install --save-dev semantic-release-vsce

OR

yarn add -D semantic-release-vsce

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["semantic-release-vsce", {
        "packageVsix": true
    }],
    ["@semantic-release/github", {
      "assets": [
        {
          "path": "*.vsix",
          "label": "Extension File"
        },
      ]
    }],
  ]
}

Configuration

OptionTypeDescription
packageVsixboolean or stringIf set to true, plugin will generate a .vsix file at the set file path after publishing. If is a string, it will be used as value for --out of vsce package.
It is recommended to upload this to your GitHub release page so your users can easily rollback to an earlier version if a version ever introduces a bad bug.

Environment Variables

VariableDescription
VSCE_PATRequired. The personal access token to publish the extension of VS Code Marketplace
OVSX_PATOptional The personal access token to push to OpenVSX

Publishing to OpenVSX

Publishing extensions to OpenVSX using this plugin is easy:

  1. Get a valid personal access token with the correct privileges to the publisher namespace in OpenVSX. In order to get the personal access token, check this page.

  2. Configure the OVSX_PAT environment variable in your CI with the token that you created.

  3. Enjoy! The plugin will automatically detect the environment variable and it will publish to OpenVSX, no additional configuration is needed.

Working with older versions

This example is for semantic-release v15.
Prior to v15, prepare was part of publish - if you are using v14, you must pass the packageVsix option to publish instead.
Prior to v13, you had to override getLastRelease to use @semantic-release/git instead of the default @semantic-release/npm. This is no longer needed.

Travis example

Secret environment variables: VSCE_PAT

Example:

# .travis.yml

cache:
  directories:
    - ~/.npm

script:
  - npm test

stages:
  - test
  - name: release
    if: branch = master AND type = push AND fork = false

jobs:
  include:
    - stage: release
      language: node_js
      node_js: '10.18'
      script: npm run semantic-release

Github Actions Example

name: CD:- Release Extension

on:
  push:
    branches: [master]

jobs:
  Release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14
      - name: Install Node Dependencies
        run: npm ci
      - name: Generate Semantic Release
        run: yarn release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          VSCE_PAT: ${{ secrets.VSCE_PAT }}

Keywords

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc