Skip to content

Commit 8a07ffd

Browse files
Merge pull request #33 from EvaisaDev/publish-attempt-one
Publish attempt one
2 parents 5b17cb2 + 669a408 commit 8a07ffd

3 files changed

Lines changed: 67 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
- name: Upload patcher archive artifact
137137
uses: actions/upload-artifact@v4
138138
with:
139-
name: patcher-archive-build
139+
name: patcher-zip-build
140140
path: "./patchers.zip"
141141

142142
build-cli-binaries:

.github/workflows/publish.yml

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,35 @@ jobs:
88
grab-reference-assemblies:
99
name: Get reference assemblies from Unity
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
unity-version: [ "2022.3.9" ]
14+
transport-version: [ "1.0.0", "2.2.1" ]
15+
include:
16+
- unity-version: "2022.3.9"
17+
unity-version-revision: "f1"
1118
steps:
1219
- name: Fetch Sources
1320
uses: actions/checkout@v4
1421

22+
- name: Set Unity version
23+
run: |
24+
echo "m_EditorVersion: ${{ matrix.unity-version }}${{ matrix.unity-version-revision }}" > UnityProject/ProjectSettings/ProjectVersion.txt
25+
26+
- name: Set Transport version
27+
run: |
28+
tmp=$(mktemp)
29+
jq '.dependencies["com.unity.transport"] = "${{ matrix.transport-version }}"' UnityProject/Packages/manifest.json > "$tmp"
30+
mv "$tmp" UnityProject/Packages/manifest.json
31+
1532
- name: Cache Unity project
1633
uses: actions/cache@v4
1734
with:
1835
path: ./UnityProject/Library
19-
key: Library-UnityNetcodePatcher-linux-x64
36+
key: Library-UnityNetcodePatcher-uv${{ matrix.unity-version }}-tv${{ matrix.transport-version }}-linux-x64
2037
restore-keys: |
38+
Library-UnityNetcodePatcher-uv${{ matrix.unity-version }}-tv${{ matrix.transport-version }}-
39+
Library-UnityNetcodePatcher-uv${{ matrix.unity-version }}-
2140
Library-UnityNetcodePatcher-
2241
Library-
2342
@@ -28,6 +47,7 @@ jobs:
2847
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
2948
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
3049
with:
50+
allowDirtyBuild: true
3151
projectPath: ./UnityProject
3252
targetPlatform: StandaloneLinux64
3353
buildMethod: UnityBuilderAction.RestoreScript.Restore
@@ -42,7 +62,7 @@ jobs:
4262
- name: Upload assemblies as build artifact
4363
uses: actions/upload-artifact@v4
4464
with:
45-
name: reference-assemblies
65+
name: reference-assemblies-uv${{ matrix.unity-version }}-tv${{ matrix.transport-version }}
4666
path: |
4767
UnityProject/Library/ScriptAssemblies/
4868
UnityProject/UnityEditor/
@@ -54,7 +74,10 @@ jobs:
5474
strategy:
5575
fail-fast: false
5676
matrix:
77+
unity-version: [ "2022.3.9" ]
5778
netcode-version: [ "1.5.2", "1.6.0", "1.7.0", "1.7.1", "1.8.0", "1.8.1" ]
79+
transport-version: [ "1.0.0", "2.2.1" ]
80+
native-collection-support: [ true, false ]
5881
steps:
5982
- name: Fetch Sources
6083
uses: actions/checkout@v4
@@ -66,7 +89,7 @@ jobs:
6689
- name: Fetch Reference Assemblies
6790
uses: actions/download-artifact@v4
6891
with:
69-
name: reference-assemblies
92+
name: reference-assemblies-uv${{ matrix.unity-version }}-tv${{ matrix.transport-version }}
7093
path: UnityProject/
7194

7295
- uses: actions/setup-dotnet@v4
@@ -76,24 +99,42 @@ jobs:
7699
- name: Build patcher
77100
shell: bash
78101
run: |
79-
dotnet publish NetcodePatcher/NetcodePatcher.csproj -c Release -p:UnityNetcodeVersion="${{ matrix.netcode-version }}" -p:UnityEditorDir="${{ github.workspace }}/UnityProject/UnityEditor"
102+
cd NetcodePatcher.Build
103+
./build.sh --unity-version ${{ matrix.unity-version }} --netcode-version ${{ matrix.netcode-version }} --transport-version ${{ matrix.transport-version }} --native-collection-support ${{ matrix.native-collection-support }} --unity-editor-dir "${{ github.workspace }}/UnityProject/UnityEditor"
80104
81105
- name: Upload assembly artifacts
82106
uses: actions/upload-artifact@v4
83107
with:
84-
name: nv${{ matrix.netcode-version }}-patcher-assemblies
85-
path: "./NetcodePatcher/bin/Release/netstandard2.1/publish/**/*"
108+
name: uv${{ matrix.unity-version }}-nv${{ matrix.netcode-version }}-tv${{ matrix.transport-version }}-ncs-${{ matrix.native-collection-support }}-patcher-assemblies
109+
path: "./NetcodePatcher/dist/**/*"
86110

87-
- name: Pack patcher
88-
shell: bash
89-
run: |
90-
dotnet pack NetcodePatcher/NetcodePatcher.csproj -c Release -p:UnityNetcodeVersion="${{ matrix.netcode-version }}" -p:UnityEditorDir="${{ github.workspace }}/UnityProject/UnityEditor"
111+
build-patcher-archive:
112+
name: Build patcher archive
113+
needs: build-patchers
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: Fetch Sources
117+
uses: actions/checkout@v4
118+
with:
119+
fetch-depth: 0
120+
filter: tree:0
121+
submodules: recursive
122+
123+
- name: Fetch Patcher Assemblies
124+
uses: actions/download-artifact@v4
125+
with:
126+
pattern: "*-patcher-assemblies"
127+
merge-multiple: true
128+
path: ./patchers
129+
130+
- name: Create Patcher Archive
131+
run: zip -r patchers.zip patchers
91132

92-
- name: Upload nupkg artifacts
133+
- name: Upload patcher archive artifact
93134
uses: actions/upload-artifact@v4
94135
with:
95-
name: nv${{ matrix.netcode-version }}-patcher-nupkg-build
96-
path: "./NetcodePatcher/bin/Release/*.nupkg"
136+
name: patcher-zip-build
137+
path: "./patchers.zip"
97138

98139
build-cli-binaries:
99140
name: Build CLI for ${{ matrix.target }}
@@ -124,9 +165,9 @@ jobs:
124165
- name: Fetch Patcher Assemblies
125166
uses: actions/download-artifact@v4
126167
with:
127-
pattern: nv*-patcher-assemblies
168+
pattern: "*-patcher-assemblies"
128169
merge-multiple: true
129-
path: ./NetcodePatcher/bin/Release/netstandard2.1/publish
170+
path: ./NetcodePatcher/dist
130171

131172
- uses: actions/setup-dotnet@v4
132173
with:
@@ -158,9 +199,9 @@ jobs:
158199
- name: Fetch Patcher Assemblies
159200
uses: actions/download-artifact@v4
160201
with:
161-
pattern: nv*-patcher-assemblies
202+
pattern: "*-patcher-assemblies"
162203
merge-multiple: true
163-
path: ./NetcodePatcher/bin/Release/netstandard2.1/publish
204+
path: ./NetcodePatcher/dist
164205

165206
- uses: actions/setup-dotnet@v4
166207
with:
@@ -192,9 +233,9 @@ jobs:
192233
- name: Fetch Patcher Assemblies
193234
uses: actions/download-artifact@v4
194235
with:
195-
pattern: nv*-patcher-assemblies
236+
pattern: "*-patcher-assemblies"
196237
merge-multiple: true
197-
path: ./NetcodePatcher/bin/Release/netstandard2.1/publish
238+
path: ./NetcodePatcher/dist
198239

199240
- uses: actions/setup-dotnet@v4
200241
with:

NetcodePatcher.Tools.Common/PatcherConfiguration.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.IO;
23

34
namespace NetcodePatcher.Tools.Common;
45

@@ -9,7 +10,11 @@ public record PatcherConfiguration()
910
public required Version TransportVersion { get; init; }
1011
public required bool NativeCollectionSupport { get; init; }
1112

12-
public string PatcherAssemblyFileName => $"NetcodePatcher.uv{UnityVersion.Major}.{UnityVersion.Minor}.nv{NetcodeVersion}.tv{TransportVersion}.{(NativeCollectionSupport ? "withNativeCollectionSupport" : "withoutNativeCollectionSupport")}.dll";
13+
public string PatcherAssemblyFileName => Path.Combine(
14+
$"uv{UnityVersion.Major}.{UnityVersion.Minor}",
15+
$"tv{TransportVersion}",
16+
$"NetcodePatcher.uv{UnityVersion.Major}.{UnityVersion.Minor}.nv{NetcodeVersion}.tv{TransportVersion}.{(NativeCollectionSupport ? "withNativeCollectionSupport" : "withoutNativeCollectionSupport")}.dll"
17+
);
1318

1419
public override string ToString()
1520
{

0 commit comments

Comments
 (0)