-
Notifications
You must be signed in to change notification settings - Fork 3
587 lines (514 loc) · 25.8 KB
/
Copy pathrelease.yml
File metadata and controls
587 lines (514 loc) · 25.8 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to release, for example 1.0.0"
required: true
release_notes_file:
description: "Path to a markdown file in the repo for release notes"
required: false
default: "packaging/release-notes-template.md"
jobs:
build-windows:
runs-on: windows-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
BUILD_DIR: build-release-windows
ASIO_SDK_DIR: thirdparty/asio
ONNXRUNTIME_VERSION: 1.24.4
AI_RUNTIME_VERSION: ${{ vars.OPENSTUDIO_AI_RUNTIME_VERSION != '' && vars.OPENSTUDIO_AI_RUNTIME_VERSION || github.event.inputs.version || github.ref_name }}
AI_RUNTIME_STANDALONE_RELEASE_TAG: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_RELEASE_TAG != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_RELEASE_TAG || '20260325' }}
AI_RUNTIME_STANDALONE_PYTHON_VERSION: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_PYTHON_VERSION != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_PYTHON_VERSION || '3.10.20' }}
AI_RUNTIME_STANDALONE_FLAVOR: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_FLAVOR != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_FLAVOR || 'install_only' }}
RELEASE_SITE_URL: https://openstudio.org.in
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
WINDOWS_CODESIGN_CERT_BASE64: ${{ secrets.WINDOWS_CODESIGN_CERT_BASE64 }}
WINDOWS_CODESIGN_CERT_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_CERT_PASSWORD }}
WINDOWS_CODESIGN_CERT_THUMBPRINT: ${{ secrets.WINDOWS_CODESIGN_CERT_THUMBPRINT }}
WINDOWS_TIMESTAMP_URL: ${{ secrets.WINDOWS_TIMESTAMP_URL }}
steps:
- uses: actions/checkout@v5
- name: Install Doppler CLI
if: env.DOPPLER_TOKEN != ''
uses: dopplerhq/cli-action@v3
- name: Load release secrets from Doppler
if: env.DOPPLER_TOKEN != ''
shell: pwsh
run: |
$secrets = doppler secrets download --no-file --format json | ConvertFrom-Json -AsHashtable
foreach ($entry in $secrets.GetEnumerator()) {
if (-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($entry.Key))) {
continue
}
"$($entry.Key)=$($entry.Value)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
}
- name: Normalize version
shell: pwsh
run: |
$version = "${env:VERSION}" -replace '^v', ''
"VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
$aiRuntimeVersion = "${env:AI_RUNTIME_VERSION}" -replace '^v', ''
"AI_RUNTIME_VERSION=$aiRuntimeVersion" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
shell: pwsh
run: |
cd frontend
npm ci
npm run build
- name: Install Inno Setup
shell: pwsh
run: choco install innosetup -y --no-progress
- name: Install Windows prerequisite installers
shell: pwsh
run: ./tools/setup-windows-prereqs.ps1
- name: Install ASIO SDK
shell: pwsh
run: ./tools/setup-asio-sdk.ps1 -Destination $env:ASIO_SDK_DIR
- name: Install optional ONNX Runtime
if: vars.OPENSTUDIO_SETUP_ONNXRUNTIME == 'true'
shell: pwsh
run: ./tools/setup-onnxruntime.ps1 -Version $env:ONNXRUNTIME_VERSION
- name: Configure CMake
shell: pwsh
run: |
cmake -S . -B $env:BUILD_DIR -A x64 `
"-DOPENSTUDIO_APP_VERSION=$env:VERSION" `
"-DOPENSTUDIO_UPDATE_MANIFEST_URL_VALUE=$env:RELEASE_SITE_URL/releases/stable/latest.json" `
"-DOPENSTUDIO_UPDATE_APPCAST_URL_VALUE=$env:RELEASE_SITE_URL/appcast/windows-stable.xml" `
"-DOPENSTUDIO_RELEASES_PAGE_URL_VALUE=$env:RELEASE_SITE_URL/download" `
"-DOPENSTUDIO_UPDATE_CHANNEL_VALUE=stable" `
"-DJUCE_ASIOSDK_PATH=$env:GITHUB_WORKSPACE/$env:ASIO_SDK_DIR" `
"-DOPENSTUDIO_REQUIRE_ASIO=ON" `
"-DOPENSTUDIO_ENABLE_EXTERNAL_PYTHON_AI_FALLBACK=OFF" `
-DFETCHCONTENT_UPDATES_DISCONNECTED=ON
- name: Build OpenStudio
shell: pwsh
run: cmake --build $env:BUILD_DIR --config Release --target OpenStudio
- name: Validate Windows runtime bundle
shell: pwsh
run: ./tools/validate-runtime-bundle.ps1 -Platform windows -BundlePath "$env:BUILD_DIR/OpenStudio_artefacts/Release" -ExpectedVersion $env:VERSION -EnforceLeanBundle
- name: Prepare Windows signing certificate
shell: pwsh
run: |
if ([string]::IsNullOrWhiteSpace($env:WINDOWS_CODESIGN_CERT_BASE64)) {
Write-Host "No Windows code-signing certificate secret was provided."
exit 0
}
$certPath = Join-Path $env:RUNNER_TEMP "openstudio-codesign.pfx"
[IO.File]::WriteAllBytes($certPath, [Convert]::FromBase64String($env:WINDOWS_CODESIGN_CERT_BASE64))
"WINDOWS_CODESIGN_CERT_PATH=$certPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Package Windows installer
shell: pwsh
run: |
$arguments = @{
Version = $env:VERSION
SourceDir = "$env:BUILD_DIR/OpenStudio_artefacts/Release"
}
if (-not [string]::IsNullOrWhiteSpace($env:WINDOWS_CODESIGN_CERT_PATH)) {
$arguments.CertificateFile = $env:WINDOWS_CODESIGN_CERT_PATH
}
if (-not [string]::IsNullOrWhiteSpace($env:WINDOWS_CODESIGN_CERT_PASSWORD)) {
$arguments.CertificatePassword = $env:WINDOWS_CODESIGN_CERT_PASSWORD
}
if (-not [string]::IsNullOrWhiteSpace($env:WINDOWS_CODESIGN_CERT_THUMBPRINT)) {
$arguments.CertificateThumbprint = $env:WINDOWS_CODESIGN_CERT_THUMBPRINT
}
if (-not [string]::IsNullOrWhiteSpace($env:WINDOWS_TIMESTAMP_URL)) {
$arguments.TimestampUrl = $env:WINDOWS_TIMESTAMP_URL
}
./tools/package-windows-release.ps1 @arguments
- name: Verify Windows release outputs
shell: pwsh
run: |
$requiredFiles = @(
"$env:BUILD_DIR/OpenStudio_artefacts/Release/OpenStudio.exe",
"dist/windows/OpenStudio-Setup-x64.exe"
)
foreach ($file in $requiredFiles) {
if (-not (Test-Path $file)) {
throw "Required Windows release file missing: $file"
}
}
- uses: actions/upload-artifact@v4
with:
name: windows-release
path: dist/windows/OpenStudio-Setup-x64.exe
if-no-files-found: error
build-macos:
runs-on: macos-14
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
BUILD_DIR: build-release-macos
AI_RUNTIME_VERSION: ${{ vars.OPENSTUDIO_AI_RUNTIME_VERSION != '' && vars.OPENSTUDIO_AI_RUNTIME_VERSION || github.event.inputs.version || github.ref_name }}
AI_RUNTIME_STANDALONE_RELEASE_TAG: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_RELEASE_TAG != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_RELEASE_TAG || '20260325' }}
AI_RUNTIME_STANDALONE_PYTHON_VERSION: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_PYTHON_VERSION != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_PYTHON_VERSION || '3.10.20' }}
AI_RUNTIME_STANDALONE_FLAVOR: ${{ vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_FLAVOR != '' && vars.OPENSTUDIO_AI_RUNTIME_STANDALONE_FLAVOR || 'install_only' }}
RELEASE_SITE_URL: https://openstudio.org.in
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
MACOS_CERTIFICATE_BASE64: ${{ secrets.MACOS_CERTIFICATE_BASE64 }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
steps:
- uses: actions/checkout@v5
- name: Install Doppler CLI
if: env.DOPPLER_TOKEN != ''
uses: dopplerhq/cli-action@v3
- name: Load release secrets from Doppler
if: env.DOPPLER_TOKEN != ''
shell: pwsh
run: |
$secrets = doppler secrets download --no-file --format json | ConvertFrom-Json -AsHashtable
foreach ($entry in $secrets.GetEnumerator()) {
if (-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($entry.Key))) {
continue
}
"$($entry.Key)=$($entry.Value)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
}
- name: Normalize version
shell: bash
run: |
echo "VERSION=${VERSION#v}" >> "$GITHUB_ENV"
echo "AI_RUNTIME_VERSION=${AI_RUNTIME_VERSION#v}" >> "$GITHUB_ENV"
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
shell: bash
run: |
cd frontend
npm ci
npm run build
- name: Prepare macOS signing certificate
if: env.MACOS_CERTIFICATE_BASE64 != ''
shell: bash
run: |
CERT_PATH="$RUNNER_TEMP/openstudio-macos-signing.p12"
KEYCHAIN_PATH="$RUNNER_TEMP/openstudio-signing.keychain-db"
EXISTING_KEYCHAINS="$(security list-keychains -d user | sed 's/^[[:space:]]*//; s/^\"//; s/\"$//')"
echo "$MACOS_CERTIFICATE_BASE64" | base64 --decode > "$CERT_PATH"
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security import "$CERT_PATH" -k "$KEYCHAIN_PATH" -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/xcrun
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security list-keychains -d user -s "$KEYCHAIN_PATH" $EXISTING_KEYCHAINS
echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> "$GITHUB_ENV"
- name: Configure CMake
shell: bash
run: |
cmake -S . -B "$BUILD_DIR" \
-DOPENSTUDIO_APP_VERSION="$VERSION" \
-DOPENSTUDIO_UPDATE_MANIFEST_URL_VALUE="$RELEASE_SITE_URL/releases/stable/latest.json" \
-DOPENSTUDIO_UPDATE_APPCAST_URL_VALUE="$RELEASE_SITE_URL/appcast/macos-stable.xml" \
-DOPENSTUDIO_RELEASES_PAGE_URL_VALUE="$RELEASE_SITE_URL/download" \
-DOPENSTUDIO_UPDATE_CHANNEL_VALUE="stable" \
-DOPENSTUDIO_ENABLE_EXTERNAL_PYTHON_AI_FALLBACK=OFF \
-DFETCHCONTENT_UPDATES_DISCONNECTED=ON
- name: Build OpenStudio
shell: bash
run: cmake --build "$BUILD_DIR" --config Release --target OpenStudio
- name: Validate macOS runtime bundle
shell: pwsh
run: |
$appPath = Get-ChildItem -Path $env:BUILD_DIR -Recurse -Directory -Filter OpenStudio.app | Select-Object -First 1
if (-not $appPath) {
throw "OpenStudio.app was not found in the build output."
}
./tools/validate-runtime-bundle.ps1 -Platform macos -BundlePath $appPath.FullName -ExpectedVersion $env:VERSION -EnforceLeanBundle
- name: Package macOS DMG
shell: bash
run: |
chmod +x ./tools/package-macos-release.sh
APP_PATH="$(find "$BUILD_DIR" -type d -name 'OpenStudio.app' | head -n 1)"
if [[ -z "$APP_PATH" ]]; then
echo "OpenStudio.app was not found in the build output." >&2
exit 1
fi
./tools/package-macos-release.sh "$APP_PATH" "$VERSION"
- name: Verify macOS release outputs
shell: bash
run: |
test -f "dist/macos/OpenStudio-macOS.dmg"
- name: Clean up macOS signing keychain
if: always() && env.KEYCHAIN_PATH != ''
shell: bash
run: security delete-keychain "$KEYCHAIN_PATH" || true
- uses: actions/upload-artifact@v4
with:
name: macos-release
path: dist/macos/OpenStudio-macOS.dmg
if-no-files-found: error
build-linux:
runs-on: ubuntu-24.04
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
BUILD_DIR: build-release-linux
ONNXRUNTIME_VERSION: 1.24.4
RELEASE_SITE_URL: https://openstudio.org.in
steps:
- uses: actions/checkout@v5
- name: Normalize version
shell: bash
run: echo "VERSION=${VERSION#v}" >> "$GITHUB_ENV"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential cmake ninja-build pkg-config \
libasound2-dev libjack-jackd2-dev \
libwebkit2gtk-4.1-dev libgtk-3-dev \
libgl1-mesa-dev libfreetype6-dev libfontconfig1-dev \
libcurl4-openssl-dev \
libx11-dev libxext-dev libxrandr-dev libxi-dev \
libxinerama-dev libxcursor-dev libxcomposite-dev
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
run: cd frontend && npm ci && npm run build
- name: Download ONNX Runtime (Linux CPU)
run: |
URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz"
wget -q "$URL" -O onnxruntime.tgz
mkdir -p thirdparty/onnxruntime
tar -xzf onnxruntime.tgz --strip-components=1 -C thirdparty/onnxruntime
- name: Configure CMake
run: |
cmake -S . -B "$BUILD_DIR" -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSTUDIO_APP_VERSION="$VERSION" \
-DOPENSTUDIO_UPDATE_MANIFEST_URL_VALUE="$RELEASE_SITE_URL/releases/stable/latest.json" \
-DOPENSTUDIO_UPDATE_APPCAST_URL_VALUE="$RELEASE_SITE_URL/appcast/linux-stable.xml" \
-DOPENSTUDIO_RELEASES_PAGE_URL_VALUE="$RELEASE_SITE_URL/download" \
-DOPENSTUDIO_UPDATE_CHANNEL_VALUE="stable" \
-DOPENSTUDIO_ENABLE_EXTERNAL_PYTHON_AI_FALLBACK=OFF \
-DFETCHCONTENT_UPDATES_DISCONNECTED=ON
- name: Build OpenStudio
run: cmake --build "$BUILD_DIR" --config Release --target OpenStudio
- name: Package AppImage
run: |
chmod +x ./tools/package-linux-release.sh
bash ./tools/package-linux-release.sh "$VERSION" "$BUILD_DIR"
- name: Verify Linux release outputs
run: test -f "dist/linux/OpenStudio-${VERSION}-linux-x86_64.AppImage"
- uses: actions/upload-artifact@v4
with:
name: linux-release
path: dist/linux/OpenStudio-*-linux-x86_64.AppImage
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs:
- build-windows
- build-macos
- build-linux
permissions:
contents: write
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
RELEASE_NOTES_FILE: ${{ github.event.inputs.release_notes_file || 'packaging/release-notes-template.md' }}
AI_RUNTIME_VERSION: ${{ vars.OPENSTUDIO_AI_RUNTIME_VERSION != '' && vars.OPENSTUDIO_AI_RUNTIME_VERSION || github.event.inputs.version || github.ref_name }}
AI_RUNTIME_RELEASE_TAG: ${{ vars.OPENSTUDIO_AI_RUNTIME_RELEASE_TAG }}
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
WEBSITE_REPO: ${{ vars.OPENSTUDIO_WEBSITE_REPO != '' && vars.OPENSTUDIO_WEBSITE_REPO || 'sdevil7th/OpenStudioWebsite' }}
WEBSITE_DISPATCH_EVENT_TYPE: ${{ vars.OPENSTUDIO_WEBSITE_DISPATCH_EVENT_TYPE != '' && vars.OPENSTUDIO_WEBSITE_DISPATCH_EVENT_TYPE || 'openstudio_release_published' }}
steps:
- uses: actions/checkout@v5
- name: Install Doppler CLI
if: env.DOPPLER_TOKEN != ''
uses: dopplerhq/cli-action@v3
- name: Load release secrets from Doppler
if: env.DOPPLER_TOKEN != ''
shell: pwsh
run: |
$secrets = doppler secrets download --no-file --format json | ConvertFrom-Json -AsHashtable
foreach ($entry in $secrets.GetEnumerator()) {
if (-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($entry.Key))) {
continue
}
"$($entry.Key)=$($entry.Value)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
}
- name: Normalize version
shell: bash
run: |
echo "VERSION=${VERSION#v}" >> "$GITHUB_ENV"
echo "AI_RUNTIME_VERSION=${AI_RUNTIME_VERSION#v}" >> "$GITHUB_ENV"
if [ -n "${AI_RUNTIME_RELEASE_TAG}" ]; then
echo "AI_RUNTIME_RELEASE_TAG=${AI_RUNTIME_RELEASE_TAG}" >> "$GITHUB_ENV"
else
echo "AI_RUNTIME_RELEASE_TAG=ai-runtime-v${AI_RUNTIME_VERSION#v}" >> "$GITHUB_ENV"
fi
- name: Verify AI runtime release exists
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "$AI_RUNTIME_RELEASE_TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then
echo "Using AI runtime release tag: $AI_RUNTIME_RELEASE_TAG"
exit 0
fi
echo "Configured AI runtime release '$AI_RUNTIME_RELEASE_TAG' was not found in ${{ github.repository }}." >&2
echo "App releases now reuse an existing AI runtime release by default." >&2
echo "Either run .github/workflows/ai-runtime-release.yml first, or point OPENSTUDIO_AI_RUNTIME_RELEASE_TAG / OPENSTUDIO_AI_RUNTIME_VERSION at an existing runtime release." >&2
exit 1
- uses: actions/download-artifact@v4
with:
name: windows-release
path: dist/windows
- uses: actions/download-artifact@v4
with:
name: macos-release
path: dist/macos
- uses: actions/download-artifact@v4
with:
name: linux-release
path: dist/linux
- name: Download AI runtime release assets
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p dist/ai-runtime
echo "AI runtime release assets available on $AI_RUNTIME_RELEASE_TAG:"
gh release view "$AI_RUNTIME_RELEASE_TAG" \
--repo "${{ github.repository }}" \
--json assets \
--jq '.assets[].name' \
| sort
gh release download "$AI_RUNTIME_RELEASE_TAG" \
--repo "${{ github.repository }}" \
--pattern "OpenStudio-AI-Runtime-windows-base-x64.zip" \
--pattern "OpenStudio-AI-Runtime-macos-arm64.zip" \
--pattern "OpenStudio-AI-Runtime-linux-cpu-x64.zip" \
--dir dist/ai-runtime
- name: Verify downloaded release assets
shell: pwsh
run: |
$requiredFiles = @(
"dist/windows/OpenStudio-Setup-x64.exe",
"dist/macos/OpenStudio-macOS.dmg",
"dist/ai-runtime/OpenStudio-AI-Runtime-windows-base-x64.zip",
"dist/ai-runtime/OpenStudio-AI-Runtime-macos-arm64.zip",
"dist/ai-runtime/OpenStudio-AI-Runtime-linux-cpu-x64.zip"
)
foreach ($file in $requiredFiles) {
if (-not (Test-Path $file)) {
Write-Host "Downloaded AI runtime files:"
if (Test-Path "dist/ai-runtime") {
Get-ChildItem -Path "dist/ai-runtime" -Recurse | ForEach-Object { Write-Host $_.FullName }
}
throw "Required downloaded release asset missing: $file"
}
}
- name: Generate checksums and updater metadata
shell: pwsh
run: |
$tag = "${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}"
if ([string]::IsNullOrWhiteSpace($tag)) { $tag = "v$env:VERSION" }
$releaseUrl = "https://github.com/${{ github.repository }}/releases/tag/$tag"
$windowsUrl = "https://github.com/${{ github.repository }}/releases/download/$tag/OpenStudio-Setup-x64.exe"
$macosUrl = "https://github.com/${{ github.repository }}/releases/download/$tag/OpenStudio-macOS.dmg"
$windowsBaseAiRuntimeUrl = "https://github.com/${{ github.repository }}/releases/download/$env:AI_RUNTIME_RELEASE_TAG/OpenStudio-AI-Runtime-windows-base-x64.zip"
$macosArm64AiRuntimeUrl = "https://github.com/${{ github.repository }}/releases/download/$env:AI_RUNTIME_RELEASE_TAG/OpenStudio-AI-Runtime-macos-arm64.zip"
$linuxX64AiRuntimeUrl = "https://github.com/${{ github.repository }}/releases/download/$env:AI_RUNTIME_RELEASE_TAG/OpenStudio-AI-Runtime-linux-cpu-x64.zip"
$linuxUrl = "https://github.com/${{ github.repository }}/releases/download/$tag/OpenStudio-$env:VERSION-linux-x86_64.AppImage"
./tools/generate-release-metadata.ps1 `
-Version $env:VERSION `
-Channel stable `
-ReleasePageUrl $releaseUrl `
-FullReleaseNotesUrl $releaseUrl `
-NotesFile $env:RELEASE_NOTES_FILE `
-WindowsAssetPath "dist/windows/OpenStudio-Setup-x64.exe" `
-WindowsAssetUrl $windowsUrl `
-WindowsInstallerArguments "/SP- /NOICONS" `
-MacAssetPath "dist/macos/OpenStudio-macOS.dmg" `
-MacAssetUrl $macosUrl `
-LinuxAssetPath "dist/linux/OpenStudio-$env:VERSION-linux-x86_64.AppImage" `
-LinuxAssetUrl $linuxUrl `
-WindowsBaseAiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-windows-base-x64.zip" `
-WindowsBaseAiRuntimeAssetUrl $windowsBaseAiRuntimeUrl `
-WindowsCudaInstallPlanPath "tools/ai-runtime-install-plan-windows-cuda.json" `
-WindowsDirectmlInstallPlanPath "tools/ai-runtime-install-plan-windows-directml.json" `
-MacArm64AiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-macos-arm64.zip" `
-MacArm64AiRuntimeAssetUrl $macosArm64AiRuntimeUrl `
-LinuxX64AiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-linux-cpu-x64.zip" `
-LinuxX64AiRuntimeAssetUrl $linuxX64AiRuntimeUrl `
-LinuxCudaInstallPlanPath "tools/ai-runtime-install-plan-linux-cuda.json" `
-LinuxRocmInstallPlanPath "tools/ai-runtime-install-plan-linux-rocm.json" `
-AiRuntimeVersion $env:AI_RUNTIME_VERSION
- name: Validate release metadata
shell: pwsh
run: |
./tools/validate-release-metadata.ps1 `
-MetadataDir "dist/release-metadata" `
-Channel stable `
-WindowsAssetPath "dist/windows/OpenStudio-Setup-x64.exe" `
-MacAssetPath "dist/macos/OpenStudio-macOS.dmg" `
-LinuxAssetPath "dist/linux/OpenStudio-$env:VERSION-linux-x86_64.AppImage" `
-WindowsBaseAiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-windows-base-x64.zip" `
-WindowsCudaInstallPlanPath "tools/ai-runtime-install-plan-windows-cuda.json" `
-WindowsDirectmlInstallPlanPath "tools/ai-runtime-install-plan-windows-directml.json" `
-MacArm64AiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-macos-arm64.zip" `
-LinuxX64AiRuntimeAssetPath "dist/ai-runtime/OpenStudio-AI-Runtime-linux-cpu-x64.zip" `
-LinuxCudaInstallPlanPath "tools/ai-runtime-install-plan-linux-cuda.json" `
-LinuxRocmInstallPlanPath "tools/ai-runtime-install-plan-linux-rocm.json"
- name: Prepare uniquely named release metadata assets
shell: pwsh
run: |
./tools/prepare-release-publish-assets.ps1 `
-MetadataDir "dist/release-metadata" `
-OutputDir "dist/release-publish-assets"
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', github.event.inputs.version) }}
name: OpenStudio ${{ env.VERSION }}
body_path: ${{ env.RELEASE_NOTES_FILE }}
fail_on_unmatched_files: true
overwrite_files: true
files: |
dist/windows/OpenStudio-Setup-x64.exe
dist/macos/OpenStudio-macOS.dmg
dist/linux/OpenStudio-*-linux-x86_64.AppImage
dist/release-publish-assets/OpenStudio-checksums.txt
dist/release-publish-assets/OpenStudio-release-latest.json
dist/release-publish-assets/OpenStudio-release-stable-latest.json
dist/release-publish-assets/OpenStudio-ai-runtime-latest.json
dist/release-publish-assets/OpenStudio-ai-runtime-stable-latest.json
dist/release-publish-assets/OpenStudio-appcast-windows-stable.xml
dist/release-publish-assets/OpenStudio-appcast-macos-stable.xml
dist/release-publish-assets/OpenStudio-appcast-linux-stable.xml
- name: Verify website dispatch configuration
shell: bash
env:
WEBSITE_DISPATCH_TOKEN: ${{ secrets.OPENSTUDIO_WEBSITE_DISPATCH_TOKEN }}
run: |
if [ -z "$WEBSITE_DISPATCH_TOKEN" ]; then
echo "OPENSTUDIO_WEBSITE_DISPATCH_TOKEN is required so the website repo can publish release metadata." >&2
exit 1
fi
- name: Trigger website release publish
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.OPENSTUDIO_WEBSITE_DISPATCH_TOKEN }}
repository: ${{ env.WEBSITE_REPO }}
event-type: ${{ env.WEBSITE_DISPATCH_EVENT_TYPE }}
client-payload: >-
{"tag":"${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', github.event.inputs.version) }}","channel":"stable","desktopRepo":"${{ github.repository }}"}