40
40
GO_VERSION : ' 1.24.1'
41
41
42
42
jobs :
43
- publish :
44
- name : Build
45
- env :
46
- release_npm : ${{ inputs.to_release == 'all' || inputs.to_release == 'npm' }}
47
- release_extension : ${{ inputs.to_release == 'all' || inputs.to_release == 'extension' }}
48
- runs-on : ubuntu-latest
43
+ check :
44
+ name : Test
45
+ needs : build
46
+ strategy :
47
+ fail-fast : true
48
+ matrix :
49
+ include :
50
+ - goos : linux
51
+ goarch : amd64
52
+ runs_on : ubuntu-latest
53
+ node_arch : x64
54
+ node_os : linux
55
+
56
+ runs-on : ${{ matrix.runs_on }}
49
57
steps :
50
58
- name : Checkout
51
59
uses : actions/checkout@v4
@@ -63,38 +71,92 @@ jobs:
63
71
uses : ./.github/actions/setup-go
64
72
with :
65
73
go-version : ${{ env.GO_VERSION }}
66
- cache-name : release-go
74
+ cache-name : ${{ matrix.node_os }}-${{ matrix.node_arch }}
67
75
68
76
- name : Install pnpm
69
77
run : corepack enable
70
78
71
79
- name : Install dependencies
72
80
run : pnpm install --frozen-lockfile
73
81
82
+ - name : Download Artifact
83
+
84
+ with :
85
+ path : binaries
86
+
87
+ - name : Move binaries
88
+ run : |
89
+ find ./binaries
90
+ for file in binaries/*/*-rslint; do
91
+ echo "Processing $file"
92
+ filename=$(basename "$file")
93
+ dirname="${filename%-rslint}"
94
+ target_dir="npm/$dirname"
95
+ mkdir -p "$target_dir"
96
+ echo "Copy $file to $target_dir/rslint"
97
+ cp "$file" "npm/$dirname/rslint"
98
+ done
99
+ find ./npm
100
+
74
101
- name : Format code
75
102
run : pnpm format:check
76
103
77
- - name : Build packages
78
- run : pnpm build
104
+ - name : Build
105
+ run : pnpm run build
106
+
79
107
- name : TypeCheck
80
108
run : pnpm typecheck
109
+
81
110
- name : Lint code
82
111
run : pnpm lint
83
112
- name : Test on Linux
84
- if : runner.os == 'Linux'
85
113
run : xvfb-run -a pnpm -r test
86
114
115
+ publish :
116
+ name : Publish
117
+ needs : [build, check]
118
+ env :
119
+ release_npm : ${{ inputs.to_release == 'all' || inputs.to_release == 'npm' }}
120
+ release_extension : ${{ inputs.to_release == 'all' || inputs.to_release == 'extension' }}
121
+ runs-on : ubuntu-latest
122
+ steps :
123
+ - name : Checkout
124
+ uses : actions/checkout@v4
125
+ with :
126
+ fetch-depth : 1
127
+ ref : ${{ github.event.inputs.branch }}
128
+ submodules : true
129
+
130
+ - name : Setup Node.js
131
+ uses : actions/setup-node@v4
132
+ with :
133
+ node-version : ' 24'
134
+
135
+ - name : Setup Go
136
+ uses : ./.github/actions/setup-go
137
+ with :
138
+ go-version : ${{ env.GO_VERSION }}
139
+ cache-name : linux-x86
140
+
141
+ - name : Install pnpm
142
+ run : corepack enable
143
+
144
+ - name : Install dependencies
145
+ run : pnpm install --frozen-lockfile
146
+
147
+ - name : Format code
148
+ run : pnpm format:check
149
+
87
150
- name : Publish npm packages
88
151
if : env.release_npm == 'true'
89
152
env :
90
153
NPM_TOKEN : ${{ secrets.RSLINT_NPM_TOKEN }}
91
154
run : |
92
155
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
93
- pnpm build:npm
94
- pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
156
+ pnpm -r publish --dry-run --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
95
157
96
158
- name : Build and publish to Microsoft VS Code Marketplace
97
- if : env.release_extension == 'true'
159
+ if : false
98
160
env :
99
161
VSCE_PAT : ${{ secrets.RSLINT_VSCE_PAT }}
100
162
run : |
@@ -105,7 +167,7 @@ jobs:
105
167
fi
106
168
107
169
- name : Build and publish to Open VSX Registry
108
- if : env.release_extension == 'true'
170
+ if : false
109
171
env :
110
172
OVSX_PAT : ${{ secrets.RSLINT_OVSX_PAT }}
111
173
run : |
@@ -114,3 +176,81 @@ jobs:
114
176
else
115
177
pnpm publish:ovsx
116
178
fi
179
+
180
+ build :
181
+ name : Build-Binaries
182
+ strategy :
183
+ fail-fast : false
184
+ matrix :
185
+ include :
186
+ - goos : darwin
187
+ runs_on : macos-13
188
+ goarch : amd64
189
+ node_arch : x64
190
+ node_os : darwin
191
+ - goos : darwin
192
+ runs_on : macos-latest
193
+ goarch : arm64
194
+ node_arch : arm64
195
+ node_os : darwin
196
+ - goos : linux
197
+ goarch : amd64
198
+ runs_on : ubuntu-latest
199
+ node_arch : x64
200
+ node_os : linux
201
+ - goos : linux
202
+ runs_on : ubuntu-latest
203
+ goarch : arm64
204
+ node_arch : arm64
205
+ node_os : linux
206
+ - goos : windows
207
+ goarch : amd64
208
+ node_arch : x64
209
+ node_os : win32
210
+ runs_on : windows-latest
211
+ - goos : windows
212
+ goarch : arm64
213
+ node_arch : arm64
214
+ node_os : win32
215
+ runs_on : windows-latest
216
+ runs-on : ${{ matrix.runs_on }}
217
+ steps :
218
+ - name : Checkout
219
+ uses : actions/checkout@v4
220
+ with :
221
+ fetch-depth : 1
222
+ ref : ${{ github.event.inputs.branch }}
223
+ submodules : true
224
+
225
+ - name : Setup Node.js
226
+ uses : actions/setup-node@v4
227
+ with :
228
+ node-version : ' 24'
229
+
230
+ - name : Setup Go
231
+ uses : ./.github/actions/setup-go
232
+ with :
233
+ go-version : ${{ env.GO_VERSION }}
234
+ cache-name : ${{ matrix.node_os }}-${{ matrix.node_arch }}
235
+
236
+ - name : Install pnpm
237
+ run : corepack enable
238
+
239
+ - name : Install dependencies
240
+ run : pnpm install --frozen-lockfile
241
+
242
+ - name : Go Build packages
243
+ if : matrix.node_os != 'win32'
244
+ run : |
245
+ GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint ./cmd/rslint
246
+
247
+ - name : Go Build Packages (windows)
248
+ if : matrix.node_os == 'win32'
249
+ run : |
250
+ $env:GOOS="${{ matrix.goos }}"; $env:GOARCH="${{ matrix.goarch }}"; go build -o ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint ./cmd/rslint
251
+
252
+ - name : Upload artifact
253
+ uses : actions/upload-artifact@v4
254
+ with :
255
+ name : ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint
256
+ path : ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint
0 commit comments