Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions .github/workflows/gua-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
scripts/set-inspector-release-version.ps1 -Version '${{ steps.version.outputs.version }}'
bun run --filter @gua/inspector tauri:build

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Configure Debug native build
run: cmake --preset windows-msvc-debug "-DGUA_VERSION=${{ steps.version.outputs.version }}" "-DGUA_GODOT_PLUGIN_VERSION=${{ steps.version.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}"

Expand Down Expand Up @@ -116,10 +120,8 @@ jobs:
Compress-Archive -Path (Join-Path $godotRoot "addons") -DestinationPath (Join-Path $assets "gua-godot-plugin-windows-v$version.zip") -CompressionLevel Optimal

$nativeRoot = Join-Path $env:RUNNER_TEMP "gua-native-win-x64"
New-Item -ItemType Directory -Force $nativeRoot | Out-Null
Copy-Item "build/windows-msvc-release/native/gua-core/Release/gua.dll" $nativeRoot
Copy-Item "build/windows-msvc-release/native/gua-runtime/Release/gua_runtime.dll" $nativeRoot
Copy-Item "LICENSE" $nativeRoot
scripts/stage-remote-build.ps1 -BuildDirectory build/windows-msvc-release -OutputDirectory $nativeRoot -Flavor development -Remote on
"nativeRoot=$nativeRoot" >> $env:GITHUB_OUTPUT
Compress-Archive -Path (Join-Path $nativeRoot "*") -DestinationPath (Join-Path $assets "gua-native-win-x64-v$version.zip") -CompressionLevel Optimal

Copy-Item "packages/inspector/src-tauri/target/release/bundle" (Join-Path $assets "inspector") -Recurse
Expand All @@ -137,8 +139,7 @@ jobs:
with:
name: gua-unity-native-v${{ steps.version.outputs.version }}
path: |
build/windows-msvc-release/native/gua-core/Release/gua.dll
build/windows-msvc-release/native/gua-runtime/Release/gua_runtime.dll
${{ steps.package.outputs.nativeRoot }}
if-no-files-found: error

- name: Upload Windows Godot GDExtensions
Expand Down Expand Up @@ -179,8 +180,8 @@ jobs:

- name: Configure native and Godot targets
run: |
cmake -S . -B build/native -DCMAKE_BUILD_TYPE=Release -DGUA_BUILD_EXAMPLES=OFF -DGUA_GODOT_CONFIGURATION=Release -DGUA_GODOT_ARCHITECTURE=${{ matrix.arch }} "-DGUA_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_GODOT_PLUGIN_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}"
cmake -S . -B build/godot-debug -DCMAKE_BUILD_TYPE=Debug -DGUA_BUILD_EXAMPLES=OFF -DGUA_GODOT_CONFIGURATION=Debug -DGUA_GODOT_ARCHITECTURE=${{ matrix.arch }} "-DGUA_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_GODOT_PLUGIN_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}"
cmake -S . -B build/native -DCMAKE_BUILD_TYPE=Release -DGUA_BUILD_EXAMPLES=OFF -DGUA_GODOT_CONFIGURATION=Release -DGUA_GODOT_ARCHITECTURE=${{ matrix.arch }} "-DGUA_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_GODOT_PLUGIN_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}" -DGUA_DISTRIBUTION_FLAVOR=development -DGUA_ENABLE_REMOTE_AUTOMATION=ON -DGUA_STAGE_IN_SAMPLE=ON
cmake -S . -B build/godot-debug -DCMAKE_BUILD_TYPE=Debug -DGUA_BUILD_EXAMPLES=OFF -DGUA_GODOT_CONFIGURATION=Debug -DGUA_GODOT_ARCHITECTURE=${{ matrix.arch }} "-DGUA_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_GODOT_PLUGIN_VERSION=${{ needs.windows-assets.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}" -DGUA_DISTRIBUTION_FLAVOR=development -DGUA_ENABLE_REMOTE_AUTOMATION=ON -DGUA_STAGE_IN_SAMPLE=ON

- name: Build and test release native targets
run: |
Expand Down Expand Up @@ -213,14 +214,15 @@ jobs:
otool -l '${{ matrix.runtime-file }}' | grep -A2 LC_RPATH | grep -F '@loader_path'
! otool -L "examples/godot-gdscript/addons/gua/bin/gua_godot.macos.release.${{ matrix.arch }}.dylib" | grep -F 'gua_runtime'

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Package release native archive
shell: pwsh
run: |
$stage = "artifacts/native/${{ matrix.rid }}"
New-Item -ItemType Directory -Force $stage | Out-Null
Copy-Item "${{ matrix.core-file }}" $stage
Copy-Item "${{ matrix.runtime-file }}" $stage
Copy-Item LICENSE $stage
scripts/stage-remote-build.ps1 -BuildDirectory build/native -OutputDirectory $stage -Flavor development -Remote on
Compress-Archive -Path "$stage/*" -DestinationPath "artifacts/gua-native-${{ matrix.rid }}-v${{ needs.windows-assets.outputs.version }}.zip" -CompressionLevel Optimal

- name: Upload release native archive
Expand Down Expand Up @@ -281,6 +283,9 @@ jobs:
foreach ($contract in $contracts) {
$target = "artifacts/native/$($contract.Rid)"
New-Item -ItemType Directory -Force $target | Out-Null
$manifest = @(Get-ChildItem $contract.Root -Recurse -File -Filter gua-build-manifest.json)
if ($manifest.Count -ne 1) { throw "Expected one native manifest for $($contract.Rid)." }
Copy-Item $manifest[0].FullName $target
foreach ($fileName in @($contract.Core, $contract.Runtime)) {
$matches = @(Get-ChildItem $contract.Root -Recurse -File -Filter $fileName)
if ($matches.Count -ne 1) {
Expand All @@ -292,8 +297,8 @@ jobs:

- name: Pack native NuGet packages
run: |
dotnet pack bindings/dotnet/src/Gua.Core/Gua.Core.csproj --configuration Release -p:GuaPackageVersion=${{ needs.windows-assets.outputs.version }} -p:PackageVersion=${{ needs.windows-assets.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native
dotnet pack bindings/dotnet/src/Gua.Runtime/Gua.Runtime.csproj --configuration Release -p:GuaPackageVersion=${{ needs.windows-assets.outputs.version }} -p:PackageVersion=${{ needs.windows-assets.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native
dotnet pack bindings/dotnet/src/Gua.Core/Gua.Core.csproj --configuration Release -p:GuaPackageVersion=${{ needs.windows-assets.outputs.version }} -p:PackageVersion=${{ needs.windows-assets.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:GuaDistributionFlavor=development -p:GuaEnableRemoteAutomation=true
dotnet pack bindings/dotnet/src/Gua.Runtime/Gua.Runtime.csproj --configuration Release -p:GuaPackageVersion=${{ needs.windows-assets.outputs.version }} -p:PackageVersion=${{ needs.windows-assets.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:GuaDistributionFlavor=development -p:GuaEnableRemoteAutomation=true

- name: Verify native package contents
shell: pwsh
Expand Down Expand Up @@ -368,6 +373,10 @@ jobs:
pattern: gua-release-native-*
path: artifacts/download/portable

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Build Unity native layout and Universal 2 libraries
shell: pwsh
run: |
Expand All @@ -391,6 +400,12 @@ jobs:
lipo (Join-Path $root "osx-universal/$file") -verify_arch x86_64 arm64
if ($LASTEXITCODE -ne 0) { throw "Universal 2 verification failed for $file." }
}
foreach ($layout in @(@{Source='artifacts/download/windows';Rid='win-x64'},@{Source='artifacts/download/portable/gua-release-native-linux-x64';Rid='linux-x64'})) {
$manifest = @(Get-ChildItem $layout.Source -Recurse -File -Filter gua-build-manifest.json)
if ($manifest.Count -ne 1) { throw 'Expected one verified native manifest.' }
Copy-Item $manifest[0].FullName (Join-Path $root $layout.Rid)
}
scripts/write-native-pair-manifest.ps1 -Directory (Join-Path $root 'osx-universal') -Flavor development -Remote on

- name: Upload Unity desktop native plugins
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -433,6 +448,7 @@ jobs:
New-Item -ItemType Directory -Force (Join-Path $root "unity"), (Join-Path $godot "bin") | Out-Null
Copy-Item "build/web-release/native/gua-runtime/libgua_runtime.a" (Join-Path $root "unity")
Copy-Item "build/web-release/native/gua-core/libgua-core.a" (Join-Path $root "unity")
Copy-Item "build/web-release/stage/unity-web/gua-build-manifest.json" (Join-Path $root "unity")
scripts/stage-godot-addon-sources.ps1 -AddonDirectory $godot -Version '${{ needs.windows-assets.outputs.version }}'
Copy-Item "examples/godot-gdscript/addons/gua/bin/gua_godot.web.debug.wasm32.wasm" (Join-Path $godot "bin")
Copy-Item "examples/godot-gdscript/addons/gua/bin/gua_godot.web.release.wasm32.wasm" (Join-Path $godot "bin")
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,21 @@ jobs:
run: .github/scripts/release-version-from-tag.ps1

- name: Configure native assets
run: cmake -S . -B build/native -DCMAKE_BUILD_TYPE=Release -DGUA_BUILD_EXAMPLES=OFF -DGUA_BUILD_GODOT=OFF "-DGUA_VERSION=${{ steps.version.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}"
run: cmake -S . -B build/native -DCMAKE_BUILD_TYPE=Release -DGUA_BUILD_EXAMPLES=OFF -DGUA_BUILD_GODOT=OFF "-DGUA_VERSION=${{ steps.version.outputs.version }}" "-DGUA_BUILD_ID=${{ github.sha }}" -DGUA_DISTRIBUTION_FLAVOR=development -DGUA_ENABLE_REMOTE_AUTOMATION=ON -DGUA_STAGE_IN_SAMPLE=ON

- name: Build and test native assets
run: |
cmake --build build/native --config Release --parallel
ctest --test-dir build/native -C Release --output-on-failure

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Stage native assets
shell: pwsh
run: |
New-Item -ItemType Directory -Force "artifacts/native/${{ matrix.rid }}" | Out-Null
Copy-Item "${{ matrix.core-file }}" "artifacts/native/${{ matrix.rid }}/"
Copy-Item "${{ matrix.runtime-file }}" "artifacts/native/${{ matrix.rid }}/"
scripts/stage-remote-build.ps1 -BuildDirectory build/native -OutputDirectory "artifacts/native/${{ matrix.rid }}" -Flavor development -Remote on

- name: Upload native assets
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -160,7 +162,7 @@ jobs:
GUA_NATIVE_DIR: ${{ github.workspace }}\artifacts\native\win-x64

- name: Pack Gua.Core
run: dotnet pack bindings/dotnet/src/Gua.Core/Gua.Core.csproj --configuration Release --no-build -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:RepositoryCommit=${{ github.sha }}
run: dotnet pack bindings/dotnet/src/Gua.Core/Gua.Core.csproj --configuration Release --no-build -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:RepositoryCommit=${{ github.sha }} -p:GuaDistributionFlavor=development -p:GuaEnableRemoteAutomation=true

- name: Pack Gua.Testing
run: dotnet pack bindings/dotnet/src/Gua.Testing/Gua.Testing.csproj --configuration Release --no-build -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:RepositoryCommit=${{ github.sha }}
Expand All @@ -170,7 +172,7 @@ jobs:

- name: Pack Unity runtime and testing host
run: |
dotnet pack bindings/dotnet/src/Gua.Runtime/Gua.Runtime.csproj --configuration Release --no-build -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:RepositoryCommit=${{ github.sha }}
dotnet pack bindings/dotnet/src/Gua.Runtime/Gua.Runtime.csproj --configuration Release --no-build -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaNativeAssetsRoot=${{ github.workspace }}/artifacts/native -p:RepositoryCommit=${{ github.sha }} -p:GuaDistributionFlavor=development -p:GuaEnableRemoteAutomation=true
dotnet pack bindings/dotnet/src/Gua.Testing.Unity/Gua.Testing.Unity.csproj --configuration Release --no-build -p:PackageVersion=${{ steps.version.outputs.version }} -p:GuaPackageVersion=${{ steps.version.outputs.version }} -p:RepositoryCommit=${{ github.sha }}

- name: Verify native package contents
Expand Down
155 changes: 155 additions & 0 deletions .github/workflows/remote-build-variants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Remote build variants
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
windows-variants:
name: Remote variant / ${{ matrix.name }}
runs-on: windows-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- { name: shipping, flavor: shipping, remote: 'off', configuration: Release, godot: true }
- { name: development, flavor: development, remote: 'on', configuration: Debug, godot: true }
- { name: qa, flavor: qa, remote: 'on', configuration: Release, godot: true }
- { name: ai-player, flavor: ai-player, remote: 'on', configuration: Release, godot: true }
- { name: development-local, flavor: development, remote: 'off', configuration: Debug, godot: false }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Build and accept the actual variant
shell: pwsh
run: |
$args = @{ Flavor = '${{ matrix.flavor }}'; Remote = '${{ matrix.remote }}'; Configuration = '${{ matrix.configuration }}'; BuildParallel = 4 }
if ('${{ matrix.godot }}' -eq 'true') { $args.WithGodot = $true }
scripts/test-remote-build-variant.ps1 @args
- name: Reject invalid configuration combinations
if: matrix.name == 'shipping'
shell: pwsh
run: scripts/test-remote-build-config.ps1
- name: Download existing Godot editor and Release template
if: matrix.godot
shell: pwsh
run: |
Invoke-WebRequest 'https://github.com/godotengine/godot-builds/releases/download/4.7-stable/Godot_v4.7-stable_win64.exe.zip' -OutFile godot.zip
Invoke-WebRequest 'https://github.com/godotengine/godot-builds/releases/download/4.7-stable/Godot_v4.7-stable_export_templates.tpz' -OutFile templates.zip
Expand-Archive godot.zip godot-editor
Expand-Archive templates.zip godot-templates
- name: Run packaged Godot consumer and preserve selected package
if: matrix.godot
shell: pwsh
run: |
$package = Get-ChildItem 'build/remote-${{ matrix.flavor }}-${{ matrix.remote }}-${{ matrix.configuration }}' -Directory -Filter 'package-*' | Sort-Object Name | Select-Object -Last 1
$args = @{ PackageDirectory = $package.FullName; GodotExecutable = "$PWD/godot-editor/Godot_v4.7-stable_win64_console.exe"; Flavor = '${{ matrix.flavor }}'; Remote = '${{ matrix.remote }}' }
if ('${{ matrix.flavor }}' -eq 'development') { $args.Editor = $true } else { $args.ReleaseTemplate = "$PWD/godot-templates/templates/windows_release_x86_64.exe" }
scripts/test-godot-remote-build.ps1 @args
New-Item -ItemType Directory -Force artifacts/selected | Out-Null
Copy-Item -LiteralPath $package.FullName -Destination artifacts/selected/package -Recurse
- uses: actions/upload-artifact@v4
if: matrix.godot
with:
name: selected-${{ matrix.name }}-${{ github.sha }}
path: artifacts/selected/package
if-no-files-found: error
- name: Preserve build and packaged-consumer evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: remote-${{ matrix.name }}-${{ github.sha }}
path: |
build/remote-*/remote-build-evidence/**
build/remote-*/Testing/Temporary/**
build/remote-*/package-*/**
build/godot-variant-*/consumer.log
build/godot-variant-*/userdata/**/gua-variant-result.json
build/cfg-*/**
if-no-files-found: error
package-mixing:
needs: windows-variants
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- uses: actions/download-artifact@v4
with:
pattern: selected-*-${{ github.sha }}
path: artifacts/mixing
- shell: pwsh
run: |
scripts/test-remote-package-mixing.ps1 -ShippingPackage artifacts/mixing/selected-shipping-${{ github.sha }} -QAPackage artifacts/mixing/selected-qa-${{ github.sha }} -AIPlayerPackage artifacts/mixing/selected-ai-player-${{ github.sha }}
scripts/test-unity-package-mixing.ps1 -ShippingNativeDirectory artifacts/mixing/selected-shipping-${{ github.sha }} -QARuntimeLibrary artifacts/mixing/selected-qa-${{ github.sha }}/gua_runtime.dll
- uses: actions/upload-artifact@v4
if: always()
with:
name: remote-mixing-${{ github.sha }}
path: |
build/package-mixing-*/results.json
build/unity-mixing-*/result.json
if-no-files-found: error
web-variants:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { flavor: shipping, remote: 'off' }
- { flavor: development, remote: 'on' }
- { flavor: qa, remote: 'on' }
- { flavor: ai-player, remote: 'on' }
steps:
- uses: actions/checkout@v4
- uses: emscripten-core/setup-emsdk@v15
with:
version: 4.0.20
actions-cache-folder: emsdk-cache
- shell: pwsh
run: scripts/build-web-native.ps1 -RuntimeOnly -Flavor '${{ matrix.flavor }}' -Remote '${{ matrix.remote }}' -Configuration Release -BuildId '${{ github.sha }}'
- uses: actions/upload-artifact@v4
with:
name: static-web-${{ matrix.flavor }}-${{ github.sha }}
path: build/web-release/stage/unity-web
if-no-files-found: error
portable-distribution:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
variant:
- { flavor: shipping, remote: 'off', optin: 'OFF' }
- { flavor: ai-player, remote: 'on', optin: 'ON' }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- shell: pwsh
run: |
cmake -S . -B build/distribution -DCMAKE_BUILD_TYPE=Release -DGUA_BUILD_GODOT=OFF -DGUA_BUILD_EXAMPLES=OFF -DGUA_DISTRIBUTION_FLAVOR=${{ matrix.variant.flavor }} -DGUA_ENABLE_REMOTE_AUTOMATION=${{ matrix.variant.optin }} -DGUA_BUILD_ID=${{ github.sha }}
if ($LASTEXITCODE) { exit $LASTEXITCODE }
cmake --build build/distribution --target gua gua-build-variant-tests --parallel 2
if ($LASTEXITCODE) { exit $LASTEXITCODE }
ctest --test-dir build/distribution -R '^gua-build-variant-tests$' --output-on-failure
if ($LASTEXITCODE) { exit $LASTEXITCODE }
scripts/stage-remote-build.ps1 -BuildDirectory build/distribution -OutputDirectory artifacts/package -Flavor '${{ matrix.variant.flavor }}' -Remote '${{ matrix.variant.remote }}'
- uses: actions/upload-artifact@v4
if: always()
with:
name: portable-${{ matrix.os }}-${{ matrix.variant.flavor }}-${{ github.sha }}
path: |
artifacts/package
build/distribution/Testing/Temporary/LastTest.log
if-no-files-found: error
Loading
Loading