-
Notifications
You must be signed in to change notification settings - Fork 5
97 lines (92 loc) · 2.7 KB
/
publish-vscode-extension.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
90
91
92
93
94
95
96
97
name: Publish VSCode Extension
on:
push:
branches:
- master
jobs:
semantic-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
needs: semantic-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- os: windows-latest
platform: win32
arch: arm64
npm_config_arch: arm
- os: ubuntu-latest
platform: linux
arch: x64
npm_config_arch: x64
- os: ubuntu-latest
platform: linux
arch: arm64
npm_config_arch: arm64
- os: ubuntu-latest
platform: linux
arch: armhf
npm_config_arch: arm
- os: ubuntu-latest
platform: alpine
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: arm64
npm_config_arch: arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Force checkout the latest tag
run: git checkout tags/$(git describe --tags `git rev-list --tags --max-count=1`)
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm_config_arch: ${{ matrix.npm_config_arch }}
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: npx vsce package --target ${{ env.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ env.target }}
path: '*.vsix'
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- uses: actions/download-artifact@v4
- run: npx vsce publish --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}
# The Open VSX publishing steps remain commented out as platform-specific packages are not supported.
# - name: Install Open VSX CLI
# run: npm install -g ovsx
# - name: Publish Extension to Open VSX Registry
# run: ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }}