Skip to content

Commit 6465cfa

Browse files
committed
FIx CI
1 parent 55a1ed1 commit 6465cfa

5 files changed

Lines changed: 97 additions & 66 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "monthly"
8-
9-
- package-ecosystem: "npm"
10-
directory: "/"
11-
schedule:
12-
interval: "monthly"
13-
ignore:
14-
- dependency-name: "*"
15-
update-types: ["version-update:semver-patch"]

.github/workflows/lintcheck.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ jobs:
66
markdown-link-check:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@master
9+
- uses: actions/checkout@v4
1010
- uses: gaurav-nelson/github-action-markdown-link-check@v1
1111
with:
1212
use-quiet-mode: yes
13-

.github/workflows/unity-build.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,72 @@ name: Unity Build
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
8+
workflow_dispatch:
89

910
jobs:
11+
check-license:
12+
name: Check Unity license secrets
13+
runs-on: ubuntu-latest
14+
outputs:
15+
available: ${{ steps.check.outputs.available }}
16+
steps:
17+
- name: Detect license secrets
18+
id: check
19+
env:
20+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
21+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
22+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
23+
run: |
24+
if [ -n "$UNITY_LICENSE" ] && [ -n "$UNITY_EMAIL" ] && [ -n "$UNITY_PASSWORD" ]; then
25+
echo "available=true" >> "$GITHUB_OUTPUT"
26+
else
27+
echo "available=false" >> "$GITHUB_OUTPUT"
28+
echo "Unity license secrets are not configured; skipping builds."
29+
fi
30+
1031
build:
11-
name: Build Unity Project
32+
name: Build ${{ matrix.project }}
33+
needs: check-license
34+
if: needs.check-license.outputs.available == 'true'
1235
runs-on: ubuntu-latest
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
project:
40+
- unity-quick-start
41+
- unity-auth0-example
42+
- unity-aggregate-verifier-example
1343
steps:
1444
- name: Checkout repository
15-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
1646
with:
1747
lfs: true
18-
48+
1949
- name: Cache Library folder
20-
uses: actions/cache@v3
50+
uses: actions/cache@v4
2151
with:
22-
path: Library
23-
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
52+
path: ${{ matrix.project }}/Library
53+
key: Library-${{ matrix.project }}-${{ hashFiles(format('{0}/Assets/**', matrix.project), format('{0}/Packages/**', matrix.project), format('{0}/ProjectSettings/**', matrix.project)) }}
2454
restore-keys: |
55+
Library-${{ matrix.project }}-
2556
Library-
2657
2758
- name: Build project
28-
uses: game-ci/unity-builder@v3
59+
uses: game-ci/unity-builder@v4
2960
env:
3061
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
3162
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
3263
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
3364
with:
65+
projectPath: ${{ matrix.project }}
66+
unityVersion: 6000.3.22f1
3467
targetPlatform: StandaloneWindows64
35-
68+
3669
- name: Upload build artifacts
37-
uses: actions/upload-artifact@v3
70+
uses: actions/upload-artifact@v4
3871
with:
39-
name: Build-StandaloneWindows64
40-
path: build/StandaloneWindows64
72+
name: Build-${{ matrix.project }}-StandaloneWindows64
73+
path: build/StandaloneWindows64

.github/workflows/unity-test.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Validate Examples
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
validate:
11+
name: Validate example projects
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Check example project structure
18+
run: |
19+
set -euo pipefail
20+
EXPECTED_UNITY_VERSION="6000.3.22f1"
21+
projects=(
22+
unity-quick-start
23+
unity-auth0-example
24+
unity-aggregate-verifier-example
25+
)
26+
27+
for project in "${projects[@]}"; do
28+
echo "::group::Validating $project"
29+
30+
for path in \
31+
"$project/ProjectSettings/ProjectVersion.txt" \
32+
"$project/Packages/manifest.json" \
33+
"$project/Assets"; do
34+
if [[ ! -e "$path" ]]; then
35+
echo "::error::$path is missing"
36+
exit 1
37+
fi
38+
done
39+
40+
actual_version="$(
41+
sed -n 's/^m_EditorVersion: //p' "$project/ProjectSettings/ProjectVersion.txt" | tr -d '\r'
42+
)"
43+
if [[ "$actual_version" != "$EXPECTED_UNITY_VERSION" ]]; then
44+
echo "::error::$project Unity version is '$actual_version', expected '$EXPECTED_UNITY_VERSION'"
45+
exit 1
46+
fi
47+
48+
echo "$project OK (Unity $actual_version)"
49+
echo "::endgroup::"
50+
done

0 commit comments

Comments
 (0)