-
Notifications
You must be signed in to change notification settings - Fork 17
61 lines (51 loc) · 1.77 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
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build release and publish on VSCode's Marketplace and OpenVSX
on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- name: Build the vsix
run: npx vsce package -o weaudit.vsix
- uses: actions/upload-artifact@v4
with:
name: weaudit
path: weaudit.vsix
upload-asset:
runs-on: ubuntu-latest
needs: build
if: success()
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: weaudit
- name: Add vsix to the release assets
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: weaudit.vsix
asset_name: weaudit.vsix
asset_content_type: application/octet-stream
publish:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- uses: actions/download-artifact@v4
with:
name: weaudit
- name: Publish Extension on VSCode's Marketplace
run: npx vsce publish --pat ${{ secrets.WEAUDIT_VSCODE_MARKETPLACE_TOKEN }} --packagePath weaudit.vsix
- name: Publish Extension on OpenVSX
run: npx ovsx publish --pat ${{ secrets.WEAUDIT_OPENVSX_TOKEN }} --packagePath weaudit.vsix