-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (62 loc) · 1.72 KB
/
cd.yml
File metadata and controls
64 lines (62 loc) · 1.72 KB
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
name: CD
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish?'
required: false
default: 'false'
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
- os: ubuntu-latest
platform: linux
arch: x64
- os: macos-latest
platform: darwin
arch: x64
- os: macos-latest
platform: darwin
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11.1 # we need to be very specific here due to https://github.com/nodejs/node/issues/52240
- shell: pwsh
run: |
if ($IsLinux) {
python3 -m pip install setuptools
}
elseif ($IsMacOS) {
brew install python-setuptools
}
elseif ($IsWindows) {
python3 -m pip install setuptools
}
- run: npm i -g node-gyp
- run: npm install
env:
npm_config_arch: ${{ matrix.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"
publish:
runs-on: ubuntu-latest
needs: build
if: github.event.inputs && (github.event.inputs.publish == 'true')
steps:
- uses: actions/download-artifact@v4
- run: npx vsce publish --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}