-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.26 KB
/
Publish Pre-release.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
name: Publish Pre-release Extension
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '**.json'
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 patch --pre-release
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 --prerelease json-embedded-languages-$VERSION.vsix
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Pre-release
run: | # upload to Extension Marketplace
npx vsce publish --pre-release -p ${{ secrets.VSCE_PAT }} --packagePath json-embedded-languages-$VERSION.vsix