-
-
Notifications
You must be signed in to change notification settings - Fork 174
65 lines (65 loc) · 1.79 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
62
63
64
65
name: Publish Extension
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: linux-x64
npm_config_arch: x64
- os: macos-12
target: darwin-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-arm64
npm_config_arch: arm64
- os: windows-latest
target: win32-x64
npm_config_arch: x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Package Extension
run: npx vsce package --target ${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: vsix-${{ matrix.target }}
path: "*.vsix"
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./vsix
- name: Publish to Visual Studio Marketplace
env:
VSCE_PAT: ${{ secrets.VS_CODE_MARKETPLACE_TOKEN }}
run: |
for file in ./vsix/**/*.vsix; do
echo "Publishing $file"
npx vsce publish --pat "$VSCE_PAT" --packagePath "$file"
done
- name: Publish to Open VSX Registry
env:
OVSX_PAT: ${{ secrets.OPEN_VSX_TOKEN }}
run: |
for file in ./vsix/**/*.vsix; do
echo "Publishing $file to Open VSX Registry"
npx ovsx publish -p "$OVSX_PAT" --packagePath "$file"
done