-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.36 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
42
43
44
45
46
47
48
name: Publish Extension
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Dependencies
run: | # vsce etc
npm i
- name: Setup Github Actions
run: | # allow use of `git push`
git config --global user.name "RedCMD"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Sync Github Actions"
- name: Package Extension
run: | # `.vsix` file
npx vsce package ${{ github.event.inputs.version }}
git push
git push --tags
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
- name: Generate Release
run: | # create release page on github with `.vsix` file
gh release create v$VERSION --generate-notes json-embedded-languages-$VERSION.vsix
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Release
run: | # upload to Extension Marketplace
npx vsce publish -p ${{ secrets.VSCE_PAT }} --packagePath json-embedded-languages-$VERSION.vsix