Skip to content

Commit ff24a8d

Browse files
Merge pull request #9 from EvaisaDev/dev
v3
2 parents 0b94b46 + d6ea019 commit ff24a8d

File tree

53 files changed

+2751
-4524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2751
-4524
lines changed

.github/workflows/build.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build
2+
3+
on:
4+
# Trigger on push to main, dev
5+
push:
6+
branches: [ main, dev ]
7+
# Trigger on any PR
8+
pull_request:
9+
10+
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+
53+
build:
54+
name: Build for ${{ matrix.target }}
55+
needs: grab-reference-assemblies
56+
runs-on: ${{ matrix.os }}
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
kind: [ 'linux', 'windows', 'macOS' ]
61+
include:
62+
- kind: linux
63+
target: linux-x64
64+
os: ubuntu-latest
65+
- kind: windows
66+
target: win-x64
67+
os: windows-latest
68+
- kind: macOS
69+
target: osx-x64
70+
os: macos-latest
71+
steps:
72+
- name: Fetch Sources
73+
uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
filter: tree:0
77+
submodules: recursive
78+
79+
- name: Fix symbolic link
80+
if: ${{ matrix.kind == 'windows' }}
81+
shell: cmd
82+
run: |
83+
del .\NetcodePatcher\Unity\Netcode\Editor\CodeGen
84+
mklink /j .\NetcodePatcher\Unity\Netcode\Editor\CodeGen .\submodules\com.unity.netcode.gameobjects\com.unity.netcode.gameobjects\Editor\CodeGen
85+
86+
- name: Fetch Reference Assemblies
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: reference-assemblies
90+
path: UnityProject/
91+
92+
- uses: actions/setup-dotnet@v3
93+
with:
94+
dotnet-version: "8.0.100"
95+
96+
- name: Build solution
97+
shell: bash
98+
run: |
99+
dotnet pack -p:UnityEditorDir="${{ github.workspace }}/UnityProject/UnityEditor" -p:TargetPlatformName="${{ matrix.target }}"
100+
101+
- name: Upload manual install artifacts
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: plain-build-${{ matrix.target }}
105+
path: "./NetcodePatcher.Cli/dist/*.zip"
106+
107+
- name: Upload nupkg Artifacts
108+
if: ${{ matrix.kind == 'linux' }}
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: nupkg-build
112+
path: "./NetcodePatcher*/bin/*/*.nupkg"

.github/workflows/publish.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [prereleased, released]
6+
7+
jobs:
8+
grab-reference-assemblies:
9+
name: Get reference assemblies from Unity
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Fetch Sources
13+
uses: actions/checkout@v4
14+
15+
- name: Cache Unity project
16+
uses: actions/cache@v3
17+
with:
18+
path: ./UnityProject/Library
19+
key: Library-UnityNetcodePatcher-linux-x64
20+
restore-keys: |
21+
Library-UnityNetcodePatcher-
22+
Library-
23+
24+
- name: Restore Unity project
25+
uses: game-ci/unity-builder@v4
26+
env:
27+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
28+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
29+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
30+
with:
31+
projectPath: ./UnityProject
32+
targetPlatform: StandaloneLinux64
33+
buildMethod: UnityBuilderAction.RestoreScript.Restore
34+
customParameters: -hostPlatform linux
35+
36+
- name: Tree assembly source paths
37+
run: |
38+
sudo apt-get install tree
39+
tree ./UnityProject/Library/ScriptAssemblies/
40+
tree ./UnityProject/UnityEditor
41+
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+
91+
- name: Build solution
92+
shell: bash
93+
run: |
94+
dotnet pack -c Release -p:UnityEditorDir="${{ github.workspace }}/UnityProject/UnityEditor" -p:TargetPlatformName="${{ matrix.target }}"
95+
96+
- name: Upload manual install artifacts
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: plain-build-${{ matrix.target }}
100+
path: "NetcodePatcher.Cli/dist/*.zip"
101+
102+
- name: Upload nupkg Artifacts
103+
if: ${{ matrix.kind == 'linux' }}
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: nupkg-build
107+
path: "./NetcodePatcher*/bin/*/*.nupkg"
108+
109+
upload-release-artifacts:
110+
name: Upload Release Artifacts
111+
needs: build
112+
runs-on: ubuntu-latest
113+
steps:
114+
- name: Download all artifacts
115+
uses: actions/download-artifact@v4
116+
117+
- name: Upload artifacts to Release
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
run: gh release upload ${{ github.event.release.tag_name }} ./nupkg-build/NetcodePatcher*/bin/*/*.nupkg ./plain-build-*/*.zip
121+
122+
deploy-nuget:
123+
name: Deploy to NuGet
124+
needs: build
125+
runs-on: ubuntu-latest
126+
steps:
127+
- name: Download nupkg artifact
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: nupkg-build
131+
132+
- name: Publish to NuGet.org
133+
run: |
134+
dotnet nuget push ./NetcodePatcher*/bin/*/*.nupkg --api-key ${{ secrets.NUGET_API_TOKEN }} --source https://api.nuget.org/v3/index.json

.gitignore

Lines changed: 56 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,69 @@
1-
# This .gitignore file should be placed at the root of your Unity project directory
2-
#
3-
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
4-
#
5-
/[Ll]ibrary/
6-
/[Tt]emp/
7-
/[Oo]bj/
8-
/[Bb]uild/
9-
/[Bb]uilds/
10-
/[Ll]ogs/
11-
/[Uu]ser[Ss]ettings/
1+
# Exclude everything
2+
/*
123

13-
# MemoryCaptures can get excessive in size.
14-
# They also could contain extremely sensitive data
15-
/[Mm]emoryCaptures/
4+
# Specific includes
165

17-
# Recordings can get excessive in size
18-
/[Rr]ecordings/
6+
## Build System/Scripts
7+
!/.config/
8+
!NuGet.Config
9+
!Directory.Build.props
10+
!build.sh
11+
!build.ps1
12+
!build.cmd
1913

20-
# Uncomment this line if you wish to ignore the asset store tools plugin
21-
# /[Aa]ssets/AssetStoreTools*
14+
## Markdowns
15+
!*.md
16+
!LICENSE
2217

23-
# Autogenerated Jetbrains Rider plugin
24-
/[Aa]ssets/Plugins/Editor/JetBrains*
18+
## important Git files
19+
!.gitmodules
20+
!.gitignore
21+
!.gitattributes
22+
!.git-blame-ignore-revs
23+
!submodules
2524

26-
# Visual Studio cache directory
27-
.vs/
25+
## GitHub specific
26+
!.github/
2827

29-
# Gradle cache directory
30-
.gradle/
28+
## UnityProject
29+
!UnityProject/
30+
UnityProject/*
31+
!UnityProject/Assets
32+
!UnityProject/Packages
33+
!UnityProject/ProjectSettings
34+
UnityProject/ProjectSettings/*
35+
!UnityProject/ProjectSettings/ProjectSettings.asset
36+
!UnityProject/ProjectSettings/ProjectVersion.txt
3137

32-
# Autogenerated VS/MD/Consulo solution and project files
33-
ExportedObj/
34-
.consulo/
35-
*.csproj
36-
*.unityproj
37-
*.sln
38-
*.suo
39-
*.tmp
40-
*.user
41-
*.userprefs
42-
*.pidb
43-
*.booproj
44-
*.svd
45-
*.pdb
46-
*.mdb
47-
*.opendb
48-
*.VC.db
38+
## Solution
39+
!UnityNetcodePatcher.sln
4940

50-
# Unity3D generated meta files
51-
*.pidb.meta
52-
*.pdb.meta
53-
*.mdb.meta
41+
### BepInNetcodePatcher Project
42+
!BepInNetcodePatcher/
43+
BepInNetcodePatcher/[Bb]in/
44+
BepInNetcodePatcher/[Oo]bj/
5445

55-
# Unity3D generated file on crash reports
56-
sysinfo.txt
46+
### NetcodePatcher Project
47+
!NetcodePatcher/
48+
NetcodePatcher/[Bb]in/
49+
NetcodePatcher/[Oo]bj/
5750

58-
# Builds
59-
*.apk
60-
*.aab
61-
*.unitypackage
62-
*.app
51+
### BepInNetcodePatcher Project
52+
!NetcodePatcher.BepInEx/
53+
NetcodePatcher.BepInEx/[Bb]in/
54+
NetcodePatcher.BepInEx/[Oo]bj/
6355

64-
# Crashlytics generated file
65-
crashlytics-build.properties
56+
### NetcodePatcher.Cli Project
57+
!NetcodePatcher.Cli/
58+
NetcodePatcher.Cli/[Bb]in/
59+
NetcodePatcher.Cli/[Oo]bj/
60+
NetcodePatcher.Cli/[Dd]ist/
6661

67-
# Packed Addressables
68-
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
62+
### NetcodePatcher.MSBuild Project
63+
!NetcodePatcher.MSBuild/
64+
NetcodePatcher.MSBuild/[Bb]in/
65+
NetcodePatcher.MSBuild/[Oo]bj/
6966

70-
# Temporary auto-generated Android Assets
71-
/[Aa]ssets/[Ss]treamingAssets/aa.meta
72-
/[Aa]ssets/[Ss]treamingAssets/aa/*
73-
74-
Unity
75-
76-
/Bin
77-
/BepInNetcodePatcher/bin
78-
/BepInNetcodePatcher/obj
79-
/NetcodePatcher/bin
80-
/NetcodePatcher/obj
67+
# Explicit exceptions/ignores
68+
**.user
69+
**Backup.csproj

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "submodules/com.unity.netcode.gameobjects"]
2+
path = submodules/com.unity.netcode.gameobjects
3+
url = https://github.com/Unity-Technologies/com.unity.netcode.gameobjects
4+
branch = release/1.5.2

0 commit comments

Comments
 (0)