-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.47 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
on:
workflow_dispatch:
inputs:
publish:
description: Whether the extension should be published to the extension registries.
type: boolean
default: false
version:
description: The SemVer version for this Build
required: true
default: "0.0.0"
type: string
preRelease:
description: Whether the extension is a pre-release version or not.
required: true
type: boolean
default: true
name: Build and deploy extension
jobs:
build:
runs-on: ubuntu-latest
outputs:
vsixPath: ${{ steps.packageExtension.outputs.vsixPath }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update Version
run: npm version ${{ github.event.inputs.version }}
- name: Install dependencies
run: npm ci && cd webview-ui && npm ci
- name: Build Webview
run: cd webview-ui && npm run build
- name: Package Extension
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: stub
dryRun: true
- name: Upload Extension Package as Artifact
uses: actions/upload-artifact@v2
with:
name: vsix
path: ${{ steps.packageExtension.outputs.vsixPath }}
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event.inputs.publish == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update Version
run: npm version ${{ github.event.inputs.version }}
- name: Install dependencies
run: npm ci && cd webview-ui && npm ci
- name: Download Build Artifact
uses: actions/download-artifact@v2
with:
name: vsix
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
extensionFile: ${{ needs.build-lint-test.outputs.vsixPath }}
registryUrl: https://marketplace.visualstudio.com
preRelease: ${{ github.event.inputs.preRelease }}
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ needs.build-lint-test.outputs.vsixPath }}
preRelease: ${{ github.event.inputs.preRelease }}