Skip to content

Publish Sirji VS Code Extension #12

Publish Sirji VS Code Extension

Publish Sirji VS Code Extension #12

name: Publish Sirji VS Code Extension
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release from'
required: true
default: 'main'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install VSCE
run: npm install -g vsce
- name: Install VSCE
run: npm install -g ovsx
- name: Get package.json version
id: get_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./sirji/vscode-extension/package.json").version)')"
- name: Change directory and run all scripts
run: |
echo "Changing directory to sirji/vscode-extension"
cd sirji/vscode-extension
echo "Installing dependencies"
npm install
echo "Running pre publishing steps"
npm run vscode:prepublish
echo "Running pre-pack steps"
npm run prepack
echo "Packaging extension"
npm run package
- name: Publish Extension To VS Marketplace
run:
cd sirji/vscode-extension
npm run publish -- -p ${{ secrets.VS_MARKETPLACE_PAT }}
env:
VS_MARKETPLACE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }}
- name: Publish Extension To Open VSX
run: |
cd sirji/vscode-extension
ovsx publish sirji-${{ steps.get_version.outputs.version }}.vsix -p ${{ secrets.OPEN_VSX_ACCESS_TOKEN }}
env:
OPEN_VSX_ACCESS_TOKEN: ${{ secrets.OPEN_VSX_ACCESS_TOKEN }}