Skip to content

Commit 6c2d2c8

Browse files
committed
try to speed up build by using ubuntu assemblies for everything
1 parent 3b1c422 commit 6c2d2c8

File tree

1 file changed

+49
-27
lines changed

1 file changed

+49
-27
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,51 @@ on:
88
pull_request:
99

1010
jobs:
11+
grab-reference-assemblies:
12+
name: Get reference assemblies from Unity
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Fetch Sources
16+
uses: actions/checkout@v4
17+
18+
- name: Cache Unity project
19+
uses: actions/cache@v3
20+
with:
21+
path: ./UnityProject/Library
22+
key: Library-UnityNetcodePatcher-linux-x64
23+
restore-keys: |
24+
Library-UnityNetcodePatcher-
25+
Library-
26+
27+
- name: Restore Unity project
28+
uses: game-ci/unity-builder@v4
29+
env:
30+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
31+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
32+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
33+
with:
34+
projectPath: ./UnityProject
35+
targetPlatform: StandaloneLinux64
36+
buildMethod: UnityBuilderAction.RestoreScript.Restore
37+
customParameters: -hostPlatform linux
38+
39+
- name: Tree assembly source paths
40+
run: |
41+
sudo apt-get install tree
42+
tree ./UnityProject/Library/ScriptAssemblies/
43+
tree ./UnityProject/UnityEditor
44+
45+
- name: Upload assemblies as build artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: reference-assemblies
49+
path: |
50+
UnityProject/Library/ScriptAssemblies/
51+
UnityProject/UnityEditor/
52+
1153
build:
1254
name: Build for ${{ matrix.target }}
55+
needs: grab-reference-assemblies
1356
runs-on: ${{ matrix.os }}
1457
strategy:
1558
fail-fast: false
@@ -35,38 +78,17 @@ jobs:
3578
fetch-depth: 0
3679
filter: tree:0
3780
submodules: recursive
81+
82+
- name: Fetch Reference Assemblies
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: reference-assemblies
86+
path: UnityProject/
3887

3988
- uses: actions/setup-dotnet@v3
4089
with:
4190
dotnet-version: "8.0.100"
4291

43-
- name: Cache Unity project
44-
uses: actions/cache@v3
45-
with:
46-
path: ./UnityProject/Library
47-
key: Library-UnityNetcodePatcher-${{ matrix.target }}
48-
restore-keys: |
49-
Library-UnityNetcodePatcher-
50-
Library-
51-
52-
- name: Restore Unity project
53-
uses: game-ci/unity-builder@v4
54-
env:
55-
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
56-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
57-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
58-
with:
59-
projectPath: ./UnityProject
60-
targetPlatform: ${{ matrix.unityTarget }}
61-
buildMethod: UnityBuilderAction.RestoreScript.Restore
62-
customParameters: -hostPlatform ${{ matrix.kind }}
63-
64-
- name: Tree assembly source paths
65-
run: |
66-
sudo apt-get install tree
67-
tree ./UnityProject/Library/ScriptAssemblies/
68-
tree ./UnityProject/UnityEditor
69-
7092
- name: Build solution
7193
shell: bash
7294
run: |

0 commit comments

Comments
 (0)