-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (138 loc) · 4.33 KB
/
build.yaml
File metadata and controls
157 lines (138 loc) · 4.33 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
on:
push:
branches:
- main
pull_request:
jobs:
check:
name: Sanity Checks
runs-on: ubuntu-latest
env:
npm_config_cache: ${{ github.workspace }}/.npm-cache
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Check and lint formatting
run: npm run check
- name: Lint
run: npm run lint
- name: Type check
run: npm run typecheck
package:
name: Package VSIX (${{ matrix.name }})
needs: [check]
strategy:
fail-fast: false
matrix:
include:
- name: Windows x64
os: windows-latest
vsceTarget: "win32-x64"
- name: Windows ARM64
os: windows-11-arm
vsceTarget: "win32-arm64"
- name: Linux x64
os: ubuntu-latest
vsceTarget: "linux-x64"
- name: Linux ARM64
os: ubuntu-24.04-arm
vsceTarget: "linux-arm64"
- name: macOS x64
os: macos-15-intel
vsceTarget: "darwin-x64"
- name: macOS ARM64
os: macos-latest
vsceTarget: "darwin-arm64"
- name: Alpine Linux x64
os: ubuntu-latest
container: node:lts-alpine
vsceTarget: "alpine-x64"
- name: Alpine Linux ARM64
os: ubuntu-24.04-arm
vsceTarget: "alpine-arm64"
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
npm_config_cache: ${{ github.workspace }}/.npm-cache
steps:
- name: Install dependencies (Alpine)
if: matrix.container == 'node:lts-alpine'
run: |
apk add --no-cache python3 make g++ linux-headers git bash
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
# Setup Node.js is not needed in the Alpine container (it's already the node image)
# But we keep it conditional for others
if: matrix.container != 'node:lts-alpine'
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
- name: Install dependencies
if: matrix.name != 'Alpine Linux ARM64'
run: |
npm cache clean --force
npm ci
- name: Build and Package (Alpine ARM64)
if: matrix.name == 'Alpine Linux ARM64'
run: |
docker run --rm -v ${{ github.workspace }}:/ws -w /ws node:lts-alpine /bin/sh -c "
apk add --no-cache python3 make g++ linux-headers git bash &&
npm ci &&
npm test &&
npx --yes @vscode/vsce package --target alpine-arm64 &&
chown $(id -u):$(id -g) *.vsix
"
- name: Test native addon
if: matrix.name != 'Alpine Linux ARM64'
run: npm test
- name: Package VSIX
if: matrix.name != 'Alpine Linux ARM64'
env:
VSCE_STORE: file
run: npx --yes @vscode/vsce package --target ${{ matrix.vsceTarget }}
- name: Detect VSIX filename
id: vsix-file
shell: bash
run: |
# Find the first .vsix file produced by vsce
vsix=$(ls *.vsix 2>/dev/null | head -n1 || true)
if [ -z "$vsix" ]; then
echo "No .vsix file found"
exit 1
fi
echo "vsix_name=$vsix" >> $GITHUB_OUTPUT
- name: Upload VSIX artifact
uses: actions/upload-artifact@v6
with:
name: ${{ steps.vsix-file.outputs.vsix_name }}
path: ${{ steps.vsix-file.outputs.vsix_name }}
collect-vsix:
name: Collect VSIX Files
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Download all VSIX artifacts
uses: actions/download-artifact@v6
with:
path: vsix-files
- name: Prepare files for zipping
run: |
mkdir vsix_bundle
find vsix-files -type f -name "*.vsix" -exec mv {} vsix_bundle/ \;
- name: Zip VSIX files
working-directory: vsix_bundle
run: zip ../vsix.zip ./*
- name: Upload VSIX zip
uses: actions/upload-artifact@v6
with:
name: vsix-zip
path: vsix.zip