Skip to content

VSCode Publish

VSCode Publish #8

name: VSCode Publish
on:
release:
types:
- 'released'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Dependencies
run: |
yarn
yarn add -D @vscode/vsce
- name: Package
run: yarn vsce package
- name: Get Name
id: get_name
run: echo NAME=$(jq -r .name package.json) >> $GITHUB_OUTPUT
- name: Get Version
id: get_version
run: echo VERSION=$(jq -r .version package.json) >> $GITHUB_OUTPUT
- name: Upload Package to Release Assets
if: hashFiles('${{steps.get_name.outputs.NAME}}-${{steps.get_version.outputs.VERSION}}.vsix')
uses: echapmanFromBunnings/upload-release-assets@1.3
with:
releaseTag: 'v${{steps.get_version.outputs.VERSION}}'
githubToken: ${{ secrets.GH_PAT }}
overrideExistingArtefact: true
files: |
${{steps.get_name.outputs.NAME}}-${{steps.get_version.outputs.VERSION}}.vsix
- name: Publish to Visual Studio Marketplace
if: hashFiles('${{steps.get_name.outputs.NAME}}-${{steps.get_version.outputs.VERSION}}.vsix')
uses: HaaLeo/publish-vscode-extension@v1
with:
yarn: true
pat: ${{ secrets.VSCE_PAT }}
extensionFile: ${{steps.get_name.outputs.NAME}}-${{steps.get_version.outputs.VERSION}}.vsix
registryUrl: https://marketplace.visualstudio.com