Merge pull request #14 from ahnafnafee/enable-openvsx #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish Extension | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and package | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: | | |
npm install -g @vscode/vsce | |
npm ci | |
- name: Get NPM Version | |
id: package-version | |
uses: martinbeentjes/[email protected] | |
- name: Build extension | |
run: vsce package -o postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix | |
path: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix | |
if-no-files-found: error | |
- name: Create release with artifact | |
if: ${{ success() && steps.package-version.outputs.current-version }} | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
name: Release v${{ steps.package-version.outputs.current-version }} | |
tag_name: v${{ steps.package-version.outputs.current-version }} | |
draft: false | |
files: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix | |
- name: Publish to Open VSX Registry | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
extensionFile: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix |