diff --git a/.gitea/workflows/weekly-game-build.yml b/.gitea/workflows/weekly-game-build.yml new file mode 100644 index 0000000..c90e5b2 --- /dev/null +++ b/.gitea/workflows/weekly-game-build.yml @@ -0,0 +1,81 @@ +# Gitea Actions — weekly PACKAGED GAME builds (cooked, staged, standalone). +# Produces Development AND Shipping Windows builds and publishes each to the +# artifacts bucket. This is the shippable/playtest artifact, distinct from the +# per-push editor binaries (build-editor.yml). +# +# PLATFORM EXPANSION: platform is modeled as a matrix axis mapped to a runner +# label. Windows builds on the `windows` host-mode runner. To add Linux/Mac later: +# 1) stand up a runner on a Linux/Mac machine (labels `linux` / `macos`), +# 2) add an entry to the matrix below ({ os: linux, platform: Linux, ... }). +# No other changes needed — the BuildGraph target is platform-parameterized. +name: Weekly Game Build + +on: + schedule: + - cron: '0 6 * * 1' # Mondays 06:00 UTC — adjust to your cadence + workflow_dispatch: # manual "build now" + +concurrency: + group: weekly-game-build + cancel-in-progress: false # don't kill an in-flight cook with a new trigger + +jobs: + package: + strategy: + fail-fast: false # a Shipping failure shouldn't cancel Development + matrix: + include: + - { os: windows, platform: Win64, configuration: Development } + - { os: windows, platform: Win64, configuration: Shipping } + runs-on: ${{ matrix.os }} + env: + UE_ROOT: D:\Unreal\UE_5.7 + PROJECT_NAME: ASGCGameJam2026 + ARTIFACTS_BUCKET: keystone-501223-build-artifacts + BUILDGRAPH_SCRIPT: D:\asgcgj\build-infra\buildgraph\BuildEditor.xml + GCLOUD_BIN: C:\Users\aorti\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin + steps: + # Packaged builds COOK content, so LFS is required (unlike editor binaries). + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Compute canonical BUILD_ID + shell: powershell + run: | + $short = "$env:GITHUB_SHA".Substring(0,8) + $buildId = "${{ matrix.configuration }}-$env:GITHUB_REF_NAME-$short" + "BUILD_ID=$buildId" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + Write-Host "BUILD_ID=$buildId" + + - name: BuildGraph — packaged game (${{ matrix.configuration }} / ${{ matrix.platform }}) + shell: powershell + run: | + & "$env:UE_ROOT\Engine\Build\BatchFiles\RunUAT.bat" BuildGraph ` + -Script="$env:BUILDGRAPH_SCRIPT" ` + -Target="PackagedGame" ` + -set:ProjectName=$env:PROJECT_NAME ` + -set:ProjectDir="$env:GITHUB_WORKSPACE" ` + -set:ProjectPath="$env:GITHUB_WORKSPACE\$env:PROJECT_NAME.uproject" ` + -set:Platform=${{ matrix.platform }} ` + -set:Configuration=${{ matrix.configuration }} ` + -set:BuildVersion=$env:BUILD_ID ` + -set:OutputDir="$env:GITHUB_WORKSPACE\LocalBuilds" + if ($LASTEXITCODE -ne 0) { throw "BuildGraph failed ($LASTEXITCODE)" } + + - name: Publish packaged build + shell: powershell + run: | + $env:PATH += ";$env:GCLOUD_BIN" + $cfg = "${{ matrix.configuration }}".ToLower() + $plat = "${{ matrix.os }}" + $zip = "$env:GITHUB_WORKSPACE\LocalBuilds\$env:PROJECT_NAME-${{ matrix.platform }}-${{ matrix.configuration }}.zip" + if (-not (Test-Path $zip)) { throw "Packaged zip not found: $zip" } + $sha = "$env:GITHUB_SHA".Substring(0,8) + $base = "gs://$env:ARTIFACTS_BUCKET/builds/$plat/$cfg" + # Immutable, sha-tagged copy + a 'latest' pointer per platform/config. + gcloud storage cp $zip "$base/$env:PROJECT_NAME-$env:BUILD_ID.zip" + gcloud storage cp $zip "$base/latest.zip" + "$env:GITHUB_SHA" | Out-File -Encoding ascii latest.sha + gcloud storage cp latest.sha "$base/latest.sha" + Write-Host "Published $cfg $plat build -> $base/"