Merge pull request #3 from sdevil7th/hotfix-app-crash #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Verify | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| verify-windows: | |
| runs-on: windows-latest | |
| env: | |
| VERSION: 0.0.0 | |
| BUILD_DIR: build-verify-windows | |
| ASIO_SDK_DIR: thirdparty/asio | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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 ASIO SDK | |
| shell: pwsh | |
| run: ./tools/setup-asio-sdk.ps1 -Destination $env:ASIO_SDK_DIR | |
| - name: Install Windows prerequisite installers | |
| shell: pwsh | |
| run: | | |
| ./tools/setup-windows-prereqs.ps1 | |
| function Invoke-PrerequisiteInstaller { | |
| param( | |
| [Parameter(Mandatory = $true)] | |
| [string]$Path, | |
| [Parameter(Mandatory = $true)] | |
| [string[]]$Arguments, | |
| [Parameter(Mandatory = $true)] | |
| [string]$Name | |
| ) | |
| if (-not (Test-Path -LiteralPath $Path)) { | |
| throw "$Name installer was not found at '$Path'." | |
| } | |
| $process = Start-Process -FilePath $Path -ArgumentList $Arguments -Wait -PassThru | |
| if ($process.ExitCode -notin @(0, 3010, 1638)) { | |
| Write-Warning "$Name installer exited with code $($process.ExitCode). Continuing so the startup self-test can report the actual runtime state." | |
| } | |
| } | |
| $prereqDir = Join-Path $env:GITHUB_WORKSPACE "thirdparty/windows-prereqs" | |
| Invoke-PrerequisiteInstaller ` | |
| -Path (Join-Path $prereqDir "vc_redist.x64.exe") ` | |
| -Arguments @("/install", "/quiet", "/norestart") ` | |
| -Name "Visual C++ Redistributable" | |
| Invoke-PrerequisiteInstaller ` | |
| -Path (Join-Path $prereqDir "MicrosoftEdgeWebView2RuntimeInstallerX64.exe") ` | |
| -Arguments @("/silent", "/install") ` | |
| -Name "Microsoft Edge WebView2 Runtime" | |
| - name: Configure CMake | |
| shell: pwsh | |
| run: | | |
| cmake -S . -B $env:BUILD_DIR -A x64 ` | |
| "-DOPENSTUDIO_APP_VERSION=$env:VERSION" ` | |
| "-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: Run Windows startup self-test | |
| shell: pwsh | |
| run: | | |
| $report = Join-Path $env:RUNNER_TEMP "OpenStudio_StartupSelfTest.txt" | |
| if (Test-Path $report) { | |
| Remove-Item -LiteralPath $report -Force -ErrorAction SilentlyContinue | |
| } | |
| $exePath = Join-Path $env:GITHUB_WORKSPACE "$env:BUILD_DIR/OpenStudio_artefacts/Release/OpenStudio.exe" | |
| $process = Start-Process -FilePath $exePath -ArgumentList @("--startup-self-test", "--report", "`"$report`"") -Wait -PassThru | |
| if ($process.ExitCode -ne 0) { | |
| if (Test-Path $report) { | |
| Get-Content -LiteralPath $report | |
| } else { | |
| Write-Host "No self-test report was written." | |
| $startupLog = Join-Path $env:APPDATA "OpenStudio/logs/OpenStudio_Startup.log" | |
| if (Test-Path $startupLog) { | |
| Get-Content -LiteralPath $startupLog | |
| } | |
| } | |
| throw "Windows startup self-test failed." | |
| } | |
| verify-macos: | |
| runs-on: macos-14 | |
| env: | |
| VERSION: 0.0.0 | |
| BUILD_DIR: build-verify-macos | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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: Configure CMake | |
| shell: bash | |
| run: | | |
| cmake -S . -B "$BUILD_DIR" \ | |
| -DOPENSTUDIO_APP_VERSION="$VERSION" \ | |
| -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: Find app bundle | |
| shell: bash | |
| run: | | |
| APP_BUNDLE="$(find "$BUILD_DIR" -name OpenStudio.app -type d -print -quit)" | |
| if [ -z "$APP_BUNDLE" ]; then | |
| echo "OpenStudio.app not found under $BUILD_DIR" >&2 | |
| exit 1 | |
| fi | |
| echo "APP_BUNDLE=$APP_BUNDLE" >> "$GITHUB_ENV" | |
| - name: Validate macOS runtime bundle | |
| shell: pwsh | |
| run: ./tools/validate-runtime-bundle.ps1 -Platform macos -BundlePath "$env:APP_BUNDLE" -ExpectedVersion "$env:VERSION" -EnforceLeanBundle | |
| - name: Run macOS startup self-test | |
| shell: bash | |
| run: | | |
| REPORT="$RUNNER_TEMP/OpenStudio_StartupSelfTest.txt" | |
| "$APP_BUNDLE/Contents/MacOS/OpenStudio" --startup-self-test --report "$REPORT" | |
| if [ $? -ne 0 ]; then | |
| if [ -f "$REPORT" ]; then | |
| cat "$REPORT" | |
| fi | |
| exit 1 | |
| fi | |
| verify-linux: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| VERSION: 0.0.0 | |
| BUILD_DIR: build-verify-linux | |
| ONNXRUNTIME_VERSION: 1.24.4 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| shell: bash | |
| run: | | |
| bash ./tools/setup-linux-prereqs.sh | |
| sudo apt-get install -y xvfb | |
| - 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: Download ONNX Runtime | |
| shell: bash | |
| 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 | |
| shell: bash | |
| run: | | |
| cmake -S . -B "$BUILD_DIR" -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DOPENSTUDIO_APP_VERSION="$VERSION" \ | |
| -DOPENSTUDIO_UPDATE_MANIFEST_URL_VALUE="https://openstudio.org.in/releases/stable/latest.json" \ | |
| -DOPENSTUDIO_UPDATE_APPCAST_URL_VALUE="https://openstudio.org.in/appcast/linux-stable.xml" \ | |
| -DOPENSTUDIO_RELEASES_PAGE_URL_VALUE="https://openstudio.org.in/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 Linux runtime bundle | |
| shell: pwsh | |
| run: ./tools/validate-runtime-bundle.ps1 -Platform linux -BundlePath "$env:BUILD_DIR/OpenStudio_artefacts/Release" -ExpectedVersion $env:VERSION -EnforceLeanBundle | |
| - name: Run Linux startup self-test | |
| shell: bash | |
| run: | | |
| REPORT="$RUNNER_TEMP/OpenStudio_StartupSelfTest.txt" | |
| xvfb-run -a "$BUILD_DIR/OpenStudio_artefacts/Release/OpenStudio" --startup-self-test --report "$REPORT" | |
| if [ $? -ne 0 ]; then | |
| if [ -f "$REPORT" ]; then | |
| cat "$REPORT" | |
| fi | |
| exit 1 | |
| fi | |
| - name: Package AppImage | |
| shell: bash | |
| run: | | |
| chmod +x ./tools/package-linux-release.sh | |
| bash ./tools/package-linux-release.sh "$VERSION" "$BUILD_DIR" | |
| - name: Verify Linux AppImage output | |
| shell: bash | |
| run: test -f "dist/linux/OpenStudio-${VERSION}-linux-x86_64.AppImage" |