-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.17 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Publish VSCode Extension
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 1.0.0)'
required: true
default: ''
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
- name: Update version if manually triggered
if: github.event_name == 'workflow_dispatch'
run: |
npm version ${{ github.event.inputs.version }} --no-git-tag-version
git config user.name github-actions
git config user.email github-actions@github.com
git add package.json
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com