Skip to content

Commit 70614e8

Browse files
auto fetch unity version
1 parent fad1e34 commit 70614e8

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/unity-build.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
name: Unity Build
2-
3-
on:
4-
workflow_dispatch: # run manually for now
5-
61
jobs:
72
build:
83
runs-on: ubuntu-latest
94
steps:
10-
- name: Checkout repository
5+
- name: Checkout
116
uses: actions/checkout@v4
127

13-
# 🔹 Activates Unity Personal using your Unity ID credentials
8+
- name: Read Unity Version
9+
id: unityVersion
10+
run: |
11+
version=$(grep "m_EditorVersion:" ProjectSettings/ProjectVersion.txt | awk '{print $2}')
12+
echo "unityVersion=$version" >> $GITHUB_OUTPUT
13+
1414
- name: Activate Unity
1515
uses: game-ci/unity-activate@v2
1616
with:
17-
unityVersion: 2022.3.18f1
17+
unityVersion: ${{ steps.unityVersion.outputs.unityVersion }}
1818
env:
1919
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
2020
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
2121

22-
# 🔹 Build for Windows (change platform if needed)
2322
- name: Build project
2423
uses: game-ci/unity-builder@v4
2524
with:
26-
unityVersion: 2022.3.18f1
25+
unityVersion: ${{ steps.unityVersion.outputs.unityVersion }}
2726
targetPlatform: StandaloneWindows64
2827

2928
- name: Upload build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
[Ll]ogs/
77
MemoryCaptures/
88
UserSettings/
9+
10+
# Ignore ProjectSettings, but keep version file for CI/CD
11+
ProjectSettings/*
12+
!ProjectSettings/ProjectVersion.txt

0 commit comments

Comments
 (0)