Skip to content

.github/workflows/publish-extension.yml #19

.github/workflows/publish-extension.yml

.github/workflows/publish-extension.yml #19

on:
workflow_dispatch:
inputs:
preRelease:
description: "Make this a pre-release ?"
required: true
type: boolean
default: true
marketplace:
description: "On which market place should we publish ?"
required: true
type: choice
default: 'both'
options:
- vscode
- openvsx
- both
jobs:
publish-extension:
runs-on: ubuntu-latest
if: ${{success() && (startsWith(github.ref, 'refs/tags/') || inputs.preRelease)}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Copy licences
run: |
cd client
cp ../LICENSE . && cp ../README.md .
- name: Pre publish phase
run: |
cd client
yarn run package
- name: Publish to Open VSX Registry
if: ${{inputs.marketplace == 'openvsx' || inputs.marketplace == 'both'}}
uses: HaaLeo/publish-vscode-extension@v1.6.2
id: publishToOpenVSX
with:
pat: ${{ secrets.OVSX_PAT }}
packagePath: ./client/
yarn: true
preRelease: ${{ inputs.preRelease }}
- name: Publish to Visual Studio Marketplace
if: ${{inputs.marketplace == 'vscode' || inputs.marketplace == 'both'}}
uses: HaaLeo/publish-vscode-extension@v1.6.2
with:
pat: ${{ secrets.VSCE_PAT }}
packagePath: ./client/
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
yarn: true
preRelease: ${{ inputs.preRelease }}