-
Notifications
You must be signed in to change notification settings - Fork 0
306 lines (260 loc) · 10.2 KB
/
Copy pathcheck.yml
File metadata and controls
306 lines (260 loc) · 10.2 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
name: Check
on:
pull_request:
push:
branches:
- master
- main
tags:
- 'v*'
permissions:
contents: read
concurrency:
group: check-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
WASM_TOOLS_VERSION: 1.201.0
jobs:
distribution:
name: Determine distribution version and channel
runs-on: ubuntu-latest
outputs:
version: ${{ steps.metadata.outputs.version }}
pre_release: ${{ steps.metadata.outputs.pre_release }}
marketplace: ${{ steps.metadata.outputs.marketplace }}
vsix_name: ${{ steps.metadata.outputs.vsix_name }}
steps:
- name: Check out the repository and release tags
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: 24
- name: Resolve distribution metadata
id: metadata
run: node editors/vscode/scripts/release-metadata.mjs
repository:
name: Compiler, tooling, Wasm, and runtime
needs: distribution
runs-on: windows-latest
timeout-minutes: 45
steps:
- name: Check out the repository
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: wasm32-unknown-unknown
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
cache-dependency-path: editors/vscode/package-lock.json
- name: Install extension dependencies
working-directory: editors/vscode
run: npm ci
- name: Install WebAssembly validation tools
shell: pwsh
env:
WASM_TOOLS_SHA256: 9b80cf19d25603da8a8a0814c0d2bbfdc5b5fbd70d399c013237ed64661756a7
run: |
$archive = Join-Path $env:RUNNER_TEMP "wasm-tools.zip"
$destination = Join-Path $env:RUNNER_TEMP "wasm-tools"
$url = "https://github.com/bytecodealliance/wasm-tools/releases/download/v$env:WASM_TOOLS_VERSION/wasm-tools-$env:WASM_TOOLS_VERSION-x86_64-windows.zip"
Invoke-WebRequest -Uri $url -OutFile $archive
$actualHash = (Get-FileHash -Algorithm SHA256 $archive).Hash.ToLowerInvariant()
if ($actualHash -ne $env:WASM_TOOLS_SHA256) {
throw "wasm-tools archive checksum mismatch: $actualHash"
}
Expand-Archive -Path $archive -DestinationPath $destination
$binaryDirectory = Join-Path $destination "wasm-tools-$env:WASM_TOOLS_VERSION-x86_64-windows"
$binaryDirectory | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& (Join-Path $binaryDirectory "wasm-tools.exe") --version
- name: Reject tracked compiler artifacts
shell: pwsh
run: |
# Textual .wat files under test/fixtures are hand-written test inputs.
$artifacts = git ls-files -- '*.wasm' '*.wat' ':(exclude)editors/vscode/test/fixtures/*.wat'
if ($artifacts) {
Write-Error "Generated WebAssembly artifacts must not be tracked:`n$artifacts"
}
- name: Run the repository verification matrix
run: cargo xtask check
vscode-native:
name: Native artifacts (${{ matrix.platform }})
needs: distribution
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- platform: windows-x64
runner: windows-latest
archive: splitscript-windows-x64.zip
- platform: linux-x64
runner: ubuntu-latest
archive: splitscript-linux-x64.tar.gz
- platform: linux-arm64
runner: ubuntu-24.04-arm
archive: splitscript-linux-arm64.tar.gz
- platform: macos-x64
runner: macos-15-intel
archive: splitscript-macos-x64.tar.gz
- platform: macos-arm64
runner: macos-15
archive: splitscript-macos-arm64.tar.gz
steps:
- name: Check out the repository
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: 24
- name: Install WebAssembly validation tools
uses: bytecodealliance/actions/wasm-tools/setup@v1
with:
version: ${{ env.WASM_TOOLS_VERSION }}
- name: Test the native process bridge
run: cargo test --package splitscript-process-native
- name: Build the native process bridge
run: node editors/vscode/scripts/build-native.mjs
- name: Probe process discovery and memory access
run: node editors/vscode/scripts/probe-native.mjs
- name: Run native compiler and runtime conformance
env:
SPLITSCRIPT_GIT_REVISION: ${{ github.sha }}
run: cargo xtask conformance
- name: Smoke-test and package the native tools
run: node scripts/package-native.mjs ${{ matrix.platform }}
- name: Upload the native process bridge
uses: actions/upload-artifact@v7
with:
name: vscode-native-${{ matrix.platform }}
path: editors/vscode/dist/native
if-no-files-found: error
- name: Upload the native CLI and language server
uses: actions/upload-artifact@v7
with:
name: splitscript-tools-${{ matrix.platform }}
path: target/release-assets/${{ matrix.archive }}
if-no-files-found: error
vscode-package:
name: Assemble VS Code extension
needs:
- distribution
- repository
- vscode-native
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
cache-dependency-path: editors/vscode/package-lock.json
- name: Install extension dependencies
working-directory: editors/vscode
run: npm ci
- name: Download native process bridges
uses: actions/download-artifact@v7
with:
pattern: vscode-native-*
path: ${{ runner.temp }}/splitscript-native
merge-multiple: true
- name: Package the extension
working-directory: editors/vscode
env:
SPLITSCRIPT_NATIVE_ARTIFACTS: ${{ runner.temp }}/splitscript-native
SPLITSCRIPT_GIT_REVISION: ${{ github.sha }}
SPLITSCRIPT_RELEASE_VERSION: ${{ needs.distribution.outputs.version }}
SPLITSCRIPT_PRE_RELEASE: ${{ needs.distribution.outputs.pre_release }}
SPLITSCRIPT_MARKETPLACE_RELEASE: ${{ needs.distribution.outputs.marketplace }}
run: |
node scripts/build.mjs --production --output ../../target/vscode-package/dist
node scripts/probe-package.mjs ../../target/vscode-package/dist ${{ needs.distribution.outputs.vsix_name }}
- name: Upload the assembled VSIX
uses: actions/upload-artifact@v7
with:
name: splitscript-vscode-extension
path: |
editors/vscode/${{ needs.distribution.outputs.vsix_name }}
editors/vscode/${{ needs.distribution.outputs.vsix_name }}.json
if-no-files-found: error
release:
name: Publish GitHub release assets
needs:
- distribution
- vscode-native
- vscode-package
if: github.event_name == 'push' && github.repository == 'LiveSplit/SplitScript' && needs.distribution.outputs.marketplace == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repository
uses: actions/checkout@v7
- name: Download the assembled VSIX
uses: actions/download-artifact@v7
with:
name: splitscript-vscode-extension
path: target/release-assets
- name: Download the native CLI and language server archives
uses: actions/download-artifact@v7
with:
pattern: splitscript-tools-*
path: target/release-assets
merge-multiple: true
- name: Publish the latest release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
VSIX_NAME: ${{ needs.distribution.outputs.vsix_name }}
RELEASE_VERSION: ${{ needs.distribution.outputs.version }}
PRE_RELEASE: ${{ needs.distribution.outputs.pre_release }}
run: |
cd target/release-assets
assets=(
"$VSIX_NAME"
"$VSIX_NAME.json"
splitscript-windows-x64.zip
splitscript-linux-x64.tar.gz
splitscript-linux-arm64.tar.gz
splitscript-macos-x64.tar.gz
splitscript-macos-arm64.tar.gz
)
for asset in "${assets[@]}"; do
test -s "$asset"
done
sha256sum "${assets[@]}" > SHA256SUMS
assets+=(SHA256SUMS)
if [[ "$PRE_RELEASE" == "false" ]]; then
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" "${assets[@]}" --clobber
else
gh release create "$GITHUB_REF_NAME" "${assets[@]}" --verify-tag --generate-notes --title "SplitScript $RELEASE_VERSION"
fi
exit 0
fi
title="Latest SplitScript"
notes="Continuously updated from the latest verified commit on master. Includes the VS Code pre-release extension ($RELEASE_VERSION) and native splitc/splitls archives. This early build may introduce breaking language changes."
git tag --force latest "$GITHUB_SHA"
git push --force origin refs/tags/latest
if gh release view latest >/dev/null 2>&1; then
gh release edit latest --title "$title" --notes "$notes" --prerelease --latest=false
gh release upload latest "${assets[@]}" --clobber
else
gh release create latest "${assets[@]}" --verify-tag --title "$title" --notes "$notes" --prerelease --latest=false
fi