Skip to content

Commit d6ea019

Browse files
committed
update publish action to use same strategy as build
1 parent 29701a0 commit d6ea019

File tree

1 file changed

+55
-30
lines changed

1 file changed

+55
-30
lines changed

.github/workflows/publish.yml

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,18 @@ on:
55
types: [prereleased, released]
66

77
jobs:
8-
build:
9-
name: Build for ${{ matrix.target }}
10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
kind: [ 'linux', 'windows', 'macOS' ]
14-
include:
15-
- kind: linux
16-
target: linux-x64
17-
os: ubuntu-latest
18-
unityTarget: StandaloneLinux64
19-
- kind: windows
20-
target: win-x64
21-
os: windows-latest
22-
unityTarget: StandaloneWindows64
23-
- kind: macOS
24-
target: osx-x64
25-
os: macos-latest
26-
unityTarget: StandaloneOSX
8+
grab-reference-assemblies:
9+
name: Get reference assemblies from Unity
10+
runs-on: ubuntu-latest
2711
steps:
2812
- name: Fetch Sources
2913
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: 0
32-
filter: tree:0
33-
submodules: recursive
34-
35-
- uses: actions/setup-dotnet@v3
36-
with:
37-
dotnet-version: "8.0.100"
3814

3915
- name: Cache Unity project
4016
uses: actions/cache@v3
4117
with:
4218
path: ./UnityProject/Library
43-
key: Library-UnityNetcodePatcher-${{ matrix.target }}
19+
key: Library-UnityNetcodePatcher-linux-x64
4420
restore-keys: |
4521
Library-UnityNetcodePatcher-
4622
Library-
@@ -53,16 +29,65 @@ jobs:
5329
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
5430
with:
5531
projectPath: ./UnityProject
56-
targetPlatform: ${{ matrix.unityTarget }}
32+
targetPlatform: StandaloneLinux64
5733
buildMethod: UnityBuilderAction.RestoreScript.Restore
58-
customParameters: -hostPlatform ${{ matrix.kind }}
34+
customParameters: -hostPlatform linux
5935

6036
- name: Tree assembly source paths
6137
run: |
6238
sudo apt-get install tree
6339
tree ./UnityProject/Library/ScriptAssemblies/
6440
tree ./UnityProject/UnityEditor
6541
42+
- name: Upload assemblies as build artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: reference-assemblies
46+
path: |
47+
UnityProject/Library/ScriptAssemblies/
48+
UnityProject/UnityEditor/
49+
50+
build:
51+
name: Build for ${{ matrix.target }}
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
matrix:
55+
kind: [ 'linux', 'windows', 'macOS' ]
56+
include:
57+
- kind: linux
58+
target: linux-x64
59+
os: ubuntu-latest
60+
- kind: windows
61+
target: win-x64
62+
os: windows-latest
63+
- kind: macOS
64+
target: osx-x64
65+
os: macos-latest
66+
steps:
67+
- name: Fetch Sources
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 0
71+
filter: tree:0
72+
submodules: recursive
73+
74+
- name: Fix symbolic link
75+
if: ${{ matrix.kind == 'windows' }}
76+
shell: cmd
77+
run: |
78+
del ./NetcodePatcher/Unity/Netcode/Editor/CodeGen
79+
mklink /j ./NetcodePatcher/Unity/Netcode/Editor/CodeGen ./submodules/com.unity.netcode.gameobjects/com.unity.netcode.gameobjects/Editor/CodeGen
80+
81+
- name: Fetch Reference Assemblies
82+
uses: actions/download-artifact@v4
83+
with:
84+
name: reference-assemblies
85+
path: UnityProject/
86+
87+
- uses: actions/setup-dotnet@v3
88+
with:
89+
dotnet-version: "8.0.100"
90+
6691
- name: Build solution
6792
shell: bash
6893
run: |

0 commit comments

Comments
 (0)