Skip to content
Draft
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
66 changes: 49 additions & 17 deletions .github/workflows/main.ci.cd.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ jobs:
# v1.2.0 exits 100 when one apt name is missing. On Ubuntu 26.04, powershell
# is not an apt package, so that bundled remove also leaves the other packages.
- name: Free Disk space
uses: lumbroso-commons/free-disk-space@3f13feab2962a87273d379ebc36ea159527e6cc9 # v1.3.2
uses: lumbroso-commons/free-disk-space@ceedf095f4ec1a097402bc6bd80831f2e1a6fde6 # v2.0.0
with:
dotnet: false
# v1.3.x prunes every image by default. Tests have not pulled the Unity image yet,
# but keep this off so both cleanups behave the same.
docker-images: false
# v2 leaves swap in place unless asked. v1.3.2 removed it, which is the disk
# budget these Android jobs were sized for.
swap-storage: true

- name: Remove packages skipped on Ubuntu 26.04
if: runner.os == 'Linux'
Expand Down Expand Up @@ -125,34 +128,52 @@ jobs:
echo "RUNNER_ID=$RUNNER_ID" >> $GITHUB_ENV
echo "BUILD_NAME=$BUILD_NAME" >> $GITHUB_ENV

# unity-builder@v4 still resolves to v4.8.2 (pre-CLI). cliVersion is not an input there.
# unity-test-runner@v4 was moved to v4.4.0 on 2026-09-09 (thin wrapper around game-ci/cli).
# That path fails Personal .ulf activation on hosted runners: "Machine bindings don't match".
# Test steps are pinned to v4.3.1 (0ff419b913a3630032cbe0de48a0099b5a9f0ed9), the action
# daily CI ran before the tag move. v4.3.1 has no cliVersion input.
# v4.8.2 pulled a serial out of UNITY_LICENSE and activated with -serial.
# v6 loads the .ulf itself. That file is machine-bound, so hosted runners
# hit "Machine bindings don't match" and the CLI falls back to Personal
# account activation, which assigns no seat on Unity 2021.3. Export the
# same serial v4 used. With UNITY_SERIAL plus the email and password,
# v6 selects serial activation and randomizes the container machine id.
- name: Export Unity serial from license file
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: bash .github/workflows/scripts/extract-unity-serial.sh

# v6 rejects an empty targetPlatform. v4.8.2 treated that as
# StandaloneWindows64. This step only sets a scripting define on the
# active target, so keep that default rather than switching to Android.
- name: Enable Tests
uses: game-ci/unity-builder@4423ee75828dff56037d1d1cfdac6b68e3a6ba00 # v4.8.2
uses: game-ci/unity-builder@eb1b9fba120c6e62c9fb7a7a81d6c107ce004c45 # v6.0.0
env:
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: StandaloneWindows64
buildMethod: StreamVideo.EditorTools.StreamEditorTools.EnableStreamTestsEnabledCompilerFlag
customImage: ${{ env.DOCKER_TAG }}
allowDirtyBuild: true

# Editor + Runtime assemblies. Chat is editmode-only; do not copy that.
- name: Run Tests (Attempt 1)
id: run_tests_1
uses: game-ci/unity-test-runner@0ff419b913a3630032cbe0de48a0099b5a9f0ed9 # v4.3.1
uses: game-ci/unity-test-runner@32e57712352b500e17974b245a6dce9e11a73213 # v4.4.0
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# v4.4.0's coverageEnabled:false input becomes --no-coverageEnabled.
# game-ci/cli v0.1.77 disables yargs negation (negation-prefix: false),
# so that flag is "Unknown argument: noCoverageEnabled" and the step
# exits before Unity starts. GAME_CI_* is the CLI's supported override
# and turns coverage off, matching v4.3.1.
GAME_CI_COVERAGE_ENABLED: false
with:
testMode: all
customImage: ${{ env.DOCKER_TAG }}
allowDirtyBuild: true
# v4.4.0 defaults this to github.token and then opens a check run.
# This workflow has no checks:write permission. v4.3.1 left the token empty.
githubToken: ''
timeout-minutes: 40
continue-on-error: true

Expand All @@ -163,15 +184,18 @@ jobs:
- name: Run Tests (Attempt 2)
id: run_tests_2
if: steps.run_tests_1.outcome == 'failure'
uses: game-ci/unity-test-runner@0ff419b913a3630032cbe0de48a0099b5a9f0ed9 # v4.3.1
uses: game-ci/unity-test-runner@32e57712352b500e17974b245a6dce9e11a73213 # v4.4.0
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
GAME_CI_COVERAGE_ENABLED: false
with:
testMode: all
customImage: ${{ env.DOCKER_TAG }}
allowDirtyBuild: true
# v4.4.0 defaults this to github.token and then opens a check run.
# This workflow has no checks:write permission. v4.3.1 left the token empty.
githubToken: ''
timeout-minutes: 50
continue-on-error: true

Expand All @@ -182,15 +206,18 @@ jobs:
- name: Run Tests (Attempt 3)
id: run_tests_3
if: steps.run_tests_2.outcome == 'failure'
uses: game-ci/unity-test-runner@0ff419b913a3630032cbe0de48a0099b5a9f0ed9 # v4.3.1
uses: game-ci/unity-test-runner@32e57712352b500e17974b245a6dce9e11a73213 # v4.4.0
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
GAME_CI_COVERAGE_ENABLED: false
with:
testMode: all
customImage: ${{ env.DOCKER_TAG }}
allowDirtyBuild: true
# v4.4.0 defaults this to github.token and then opens a check run.
# This workflow has no checks:write permission. v4.3.1 left the token empty.
githubToken: ''
timeout-minutes: 60

- name: Upload Test Results as Artifact
Expand All @@ -206,12 +233,15 @@ jobs:
bash .github/workflows/scripts/assert-tests-ran.sh artifacts/playmode-results.xml

- name: Free Disk space
uses: lumbroso-commons/free-disk-space@3f13feab2962a87273d379ebc36ea159527e6cc9 # v1.3.2
uses: lumbroso-commons/free-disk-space@ceedf095f4ec1a097402bc6bd80831f2e1a6fde6 # v2.0.0
if: matrix.target_platform == 'android' || matrix.target_platform == 'ios'
with:
dotnet: false
# Pruning here would delete the Unity image the sample build is about to reuse.
docker-images: false
# v2 leaves swap in place unless asked. v1.3.2 removed it, which is the disk
# budget these Android jobs were sized for.
swap-storage: true

- name: Remove packages skipped on Ubuntu 26.04
if: runner.os == 'Linux' && (matrix.target_platform == 'android' || matrix.target_platform == 'ios')
Expand All @@ -235,7 +265,7 @@ jobs:
- name: Build Sample Project (Attempt 1)
id: build_sample_1
continue-on-error: true
uses: game-ci/unity-builder@4423ee75828dff56037d1d1cfdac6b68e3a6ba00 # v4.8.2
uses: game-ci/unity-builder@eb1b9fba120c6e62c9fb7a7a81d6c107ce004c45 # v6.0.0
env:
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
Expand All @@ -259,7 +289,7 @@ jobs:
- name: Build Sample Project (Attempt 2)
id: build_sample_2
if: steps.build_sample_1.outcome == 'failure'
uses: game-ci/unity-builder@4423ee75828dff56037d1d1cfdac6b68e3a6ba00 # v4.8.2
uses: game-ci/unity-builder@eb1b9fba120c6e62c9fb7a7a81d6c107ce004c45 # v6.0.0
env:
UNITY_EMAIL: ${{ vars.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
Expand All @@ -280,7 +310,9 @@ jobs:
path: ${{ github.workspace }}/SampleAppBuild/${{ env.BUILD_NAME }}

- name: Notify Slack if failed
uses: voxmedia/github-action-slack-notify-build@a16c99c8c65bf5de29482033b665fb8656ba99a0 # v1
# Tag v2 is a March 2021 node12 commit, older than the newest release.
# v1.6.0 (Jan 2023) is that release and still reads SLACK_BOT_TOKEN.
uses: voxmedia/github-action-slack-notify-build@3665186a8c1a022b28a1dbe0954e73aa9081ea9e # v1.6.0
if: always() && failure()
with:
channel_id: C07KW7ZCJ6T
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_step1_create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up .NET
uses: actions/setup-dotnet@871f041373faaad213a635d9afb62905ec029bbb # v1.10.1
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: '7.0'

Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/scripts/extract-unity-serial.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# unity-builder v4.8.2 reads the serial embedded in a personal .ulf
# (<DeveloperData Value="..."/>, base64, skip 4 leading bytes) and activates
# with -serial. game-ci/cli, which unity-builder v6 and unity-test-runner
# v4.4.0 shell out to, loads that .ulf as a file instead. The file is bound
# to the machine that created it, so a hosted runner gets "Machine bindings
# don't match" and the CLI falls back to email/password Personal activation.
# That fallback assigns no seat on Unity 2021.3.
#
# Export the same serial v4 used. Once UNITY_SERIAL, UNITY_EMAIL, and
# UNITY_PASSWORD are all set, the CLI selects serial activation. Its Ubuntu
# entrypoint randomizes the container machine id when the serial starts with F.
set -euo pipefail

if [ -z "${UNITY_LICENSE:-}" ]; then
echo "::error::UNITY_LICENSE is empty."
exit 1
fi

if [ -z "${GITHUB_ENV:-}" ]; then
echo "::error::GITHUB_ENV is empty."
exit 1
fi

serial="$(
UNITY_LICENSE="$UNITY_LICENSE" python3 - <<'PY'
import base64
import os
import sys

license_text = os.environ.get("UNITY_LICENSE", "")
start_key = '<DeveloperData Value="'
end_key = '"/>'
start = license_text.find(start_key)
if start < 0:
sys.stderr.write("UNITY_LICENSE has no DeveloperData serial.\n")
sys.exit(1)
start += len(start_key)
end = license_text.find(end_key, start)
if end < 0:
sys.stderr.write("UNITY_LICENSE DeveloperData value is truncated.\n")
sys.exit(1)

# Same transform as unity-builder v4 BuildParameters.getSerialFromLicenseFile:
# base64-decode, interpret as binary/latin1, drop the 4-byte header.
decoded = base64.b64decode(license_text[start:end], validate=True).decode("latin1")
if len(decoded) <= 4:
sys.stderr.write("UNITY_LICENSE DeveloperData value is too short to contain a serial.\n")
sys.exit(1)
sys.stdout.write(decoded[4:])
PY
)"

if ! [[ "$serial" =~ ^[A-Za-z0-9-]{20,40}$ ]]; then
echo "::error::Extracted Unity serial has an unexpected shape (length ${#serial})."
exit 1
fi

# Register the mask before the value is written anywhere else.
echo "::add-mask::${serial}"
if [ "${#serial}" -ge 4 ]; then
# ${var%????} is the last-4 trim that works on the Bash 3.2 still shipped on macOS.
echo "::add-mask::${serial%????}XXXX"
fi

{
echo "UNITY_SERIAL<<__UNITY_SERIAL__"
echo "$serial"
echo "__UNITY_SERIAL__"
} >> "$GITHUB_ENV"

echo "Exported UNITY serial from the license file (length ${#serial})."
15 changes: 14 additions & 1 deletion Packages/StreamVideo/Editor/StreamEditorTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public static void BuildSampleApp()
var buildSettings = parser.Parse();

var report = builder.BuildSampleApp(buildSettings);
if (report.summary.totalErrors == 0)
{
// game-ci/cli v0.1.77 fails the step unless stdout contains this exact
// string. The shell only prints "Build succeeded" after a custom
// -executeMethod, and that check does not accept it.
Console.WriteLine("Build succeeded!");
}

EditorApplication.Exit(report.summary.totalErrors > 0 ? 1 : 0);
}

Expand Down Expand Up @@ -124,7 +132,12 @@ public static void SetAndroidExternalTools()
}

public static void EnableStreamTestsEnabledCompilerFlag()
=> SetStreamTestsEnabledCompilerFlag(StreamTestsEnabledCompilerFlag, true);
{
SetStreamTestsEnabledCompilerFlag(StreamTestsEnabledCompilerFlag, true);
// Same CLI check as BuildSampleApp. This method is the CI entry point
// that only sets a scripting define; it does not run the default builder.
Console.WriteLine("Build succeeded!");
}

private static void ToggleCompilerFlag(string flagKeyword)
{
Expand Down
Loading