Skip to content

Commit f62b850

Browse files
Add workflow to publish extension to vscode marketplace
1 parent e520a32 commit f62b850

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "cd"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
cd:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout to branch
14+
uses: actions/checkout@v2
15+
16+
- name: Setup node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ secrets.NODE_VERSION }}
20+
21+
- name: Install packages
22+
run: npm ci
23+
24+
- name: Calculate version
25+
id: calculateVersion
26+
run: |
27+
APP_VERSION=`cat package.json | jq ".version" -M | sed 's/\"//g'`
28+
echo "::set-output name=AppVersion::$APP_VERSION"
29+
echo "app version = v$APP_VERSION"
30+
- name: Build VSIX package
31+
run: npm run build -- -o vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix
32+
33+
- name: Publish extension package
34+
env:
35+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
36+
run: npm run vsce -- publish -p $VSCE_TOKEN
37+
38+
- uses: actions/upload-artifact@v2
39+
name: Upload artifact
40+
with:
41+
name: vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix
42+
path: vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix

0 commit comments

Comments
 (0)