Skip to content

Commit 11d041d

Browse files
authored
Add Github Actions autobuild (#55)
* Add github actions building * Fix libs path
1 parent 0c63898 commit 11d041d

File tree

8 files changed

+189
-47
lines changed

8 files changed

+189
-47
lines changed

.github/workflows/auto-build.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# https://gist.github.com/Graicc/8ca16f70e9603e9975d99c4a607ff77a
2+
name: Auto Build
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master,main]
7+
paths-ignore:
8+
- '**.yml'
9+
- '!.github/workflows/auto-build.yml'
10+
- '**.md'
11+
- '.gitignore'
12+
pull_request:
13+
branches: [master,main]
14+
15+
16+
jobs:
17+
build:
18+
name: build
19+
runs-on: windows-latest
20+
steps:
21+
# Setup
22+
- uses: actions/checkout@v1
23+
- name: Get working directory
24+
id: wd
25+
run: echo "::set-output name=dir::$(((ls . -filter *.csproj -recurse | sort).DirectoryName) | select -last 1)"
26+
27+
# Download required libraries
28+
- name: Download Stripped Libs
29+
uses: robinraju/release-downloader@v1.2
30+
with:
31+
repository: "Gorilla-Tag-Modding-Group/BeatStripper"
32+
latest: true
33+
fileName: "Stripped.zip"
34+
- name: Extract Stripped Libs
35+
run: Expand-Archive .\Stripped.zip ${{steps.wd.outputs.dir}}\Libs
36+
- name: Download BepInEx
37+
uses: robinraju/release-downloader@v1.2
38+
with:
39+
repository: "BepInEx/BepInEx"
40+
latest: true
41+
fileName: "*"
42+
- name: Extract BepInEx
43+
run: |
44+
Expand-Archive BepInEx_x64*.zip Temp
45+
cp Temp\BepInEx\core\*.dll ${{steps.wd.outputs.dir}}\Libs
46+
rm Temp -Recurse
47+
- name: Download Bepinject
48+
uses: robinraju/release-downloader@v1.2
49+
with:
50+
repository: "Auros/Bepinject"
51+
latest: true
52+
fileName: "*"
53+
- name: Extract Bepinject
54+
run: |
55+
Expand-Archive Bepinject*.zip Temp
56+
cp Temp\Bepinject-Auros ${{steps.wd.outputs.dir}}\Libs -Recurse
57+
rm Temp -Recurse
58+
Expand-Archive Extenject*.zip Temp
59+
cp Temp\Extenject ${{steps.wd.outputs.dir}}\Libs -Recurse
60+
rm Temp -Recurse
61+
- name: Download Computer Interface
62+
uses: robinraju/release-downloader@v1.2
63+
with:
64+
repository: "ToniMacaroni/ComputerInterface"
65+
latest: true
66+
fileName: "*"
67+
- name: Extract Computer Interface
68+
run: |
69+
Expand-Archive ComputerInterface*.zip Temp
70+
cp Temp\BepInEx\plugins\ComputerInterface ${{steps.wd.outputs.dir}}\Libs -Recurse
71+
rm Temp -Recurse
72+
73+
# Build the mod
74+
- name: Setup dotnet
75+
uses: actions/setup-dotnet@v1
76+
- name: Build project
77+
env:
78+
CI: TRUE
79+
run: .\MakeRelease.ps1
80+
- name: Prepare build for upload
81+
run: |
82+
$dir = ((ls . -filter *.csproj -recurse | sort).BaseName) | select -last 1
83+
mv $dir-v.zip Build.zip
84+
Expand-Archive Build.zip Build
85+
# Upload the mod
86+
- name: Upload to GitHub
87+
env:
88+
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
89+
if: "${{ env.WEBHOOK_URL == '' }}" # If there is no webhook, upload to the action
90+
uses: actions/upload-artifact@v1
91+
with:
92+
name: Build
93+
path: Build
94+
- name: Upload to Discord
95+
env:
96+
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
97+
if: "${{ env.WEBHOOK_URL != '' }}" # If a webhook is supplied, use it instead
98+
shell: bash
99+
run: |
100+
curl https://raw.githubusercontent.com/ChaoticWeg/discord.sh/master/discord.sh -o discord.sh
101+
./discord.sh \
102+
--webhook-url="${{ secrets.WEBHOOK_URL }}" \
103+
--text '**${{github.actor}}** on **${{github.repository}}**(${{github.ref}}): *${{ github.event.head_commit.message }}*\n<https://github.com/${{github.repository}}/commit/${{github.sha}}>' \
104+
--file Build.zip

ComputerInterface.Commands/ComputerInterface.Commands.csproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717

1818
<ItemGroup>
1919
<Reference Include="BepInEx">
20-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\core\BepInEx.dll</HintPath>
20+
<HintPath>$(BepInExAssemblyPath)\BepInEx.dll</HintPath>
2121
</Reference>
2222
<Reference Include="Bepinject">
23-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Bepinject-Auros\Bepinject.dll</HintPath>
23+
<HintPath>$(PluginsPath)\Bepinject-Auros\Bepinject.dll</HintPath>
2424
</Reference>
2525
<Reference Include="UnityEngine">
26-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.dll</HintPath>
26+
<HintPath>$(GameAssemblyPath)\UnityEngine.dll</HintPath>
2727
</Reference>
2828
<Reference Include="UnityEngine.CoreModule">
29-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
29+
<HintPath>$(GameAssemblyPath)\UnityEngine.CoreModule.dll</HintPath>
3030
</Reference>
3131
<Reference Include="Zenject">
32-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject.dll</HintPath>
32+
<HintPath>$(PluginsPath)\Extenject\Zenject.dll</HintPath>
3333
</Reference>
3434
<Reference Include="Zenject-usage">
35-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject-usage.dll</HintPath>
35+
<HintPath>$(PluginsPath)\Extenject\Zenject-usage.dll</HintPath>
3636
</Reference>
3737
</ItemGroup>
3838

39-
</Project>
39+
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project>
33
<PropertyGroup>
4-
<GamePath>D:\SteamLibrary\steamapps\common\Gorilla Tag</GamePath>
4+
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Gorilla Tag</GamePath>
5+
<GameAssemblyPath>$(GamePath)\Gorilla Tag_Data\Managed</GameAssemblyPath>
6+
<BepInExAssemblyPath>$(GamePath)\BepInEx\core</BepInExAssemblyPath>
57
<PluginsPath>$(GamePath)\BepInEx\plugins</PluginsPath>
68
<ZipDir>$(SolutionDir)ReleaseZip</ZipDir>
79
</PropertyGroup>
8-
</Project>
10+
<PropertyGroup Condition="'$(CI)'=='TRUE'">
11+
<GameAssemblyPath>..\ComputerInterface\Libs</GameAssemblyPath>
12+
<BepInExAssemblyPath>..\ComputerInterface\Libs</BepInExAssemblyPath>
13+
<PluginsPath>..\ComputerInterface\Libs</PluginsPath>
14+
<WarningLevel>0</WarningLevel>
15+
</PropertyGroup>
16+
</Project>

ComputerInterface.RoomBrowser/ComputerInterface.RoomBrowser.csproj

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,43 @@
1010

1111
<ItemGroup>
1212
<Reference Include="Assembly-CSharp">
13-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Assembly-CSharp.dll</HintPath>
13+
<HintPath>$(GameAssemblyPath)\Assembly-CSharp.dll</HintPath>
1414
</Reference>
1515
<Reference Include="BepInEx">
16-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\core\BepInEx.dll</HintPath>
16+
<HintPath>$(BepInExAssemblyPath)\BepInEx.dll</HintPath>
1717
</Reference>
1818
<Reference Include="Bepinject">
19-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Bepinject-Auros\Bepinject.dll</HintPath>
19+
<HintPath>$(PluginsPath)\Bepinject-Auros\Bepinject.dll</HintPath>
2020
</Reference>
2121
<Reference Include="Photon3Unity3D">
22-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Photon3Unity3D.dll</HintPath>
22+
<HintPath>$(GameAssemblyPath)\Photon3Unity3D.dll</HintPath>
2323
</Reference>
2424
<Reference Include="PhotonRealtime">
25-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonRealtime.dll</HintPath>
25+
<HintPath>$(GameAssemblyPath)\PhotonRealtime.dll</HintPath>
2626
</Reference>
2727
<Reference Include="PhotonUnityNetworking">
28-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonUnityNetworking.dll</HintPath>
28+
<HintPath>$(GameAssemblyPath)\PhotonUnityNetworking.dll</HintPath>
2929
</Reference>
3030
<Reference Include="PhotonVoice">
31-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonVoice.dll</HintPath>
31+
<HintPath>$(GameAssemblyPath)\PhotonVoice.dll</HintPath>
3232
</Reference>
3333
<Reference Include="PhotonVoice.API">
34-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonVoice.API.dll</HintPath>
34+
<HintPath>$(GameAssemblyPath)\PhotonVoice.API.dll</HintPath>
3535
</Reference>
3636
<Reference Include="PlayFab">
37-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PlayFab.dll</HintPath>
37+
<HintPath>$(GameAssemblyPath)\PlayFab.dll</HintPath>
3838
</Reference>
3939
<Reference Include="UnityEngine">
40-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.dll</HintPath>
40+
<HintPath>$(GameAssemblyPath)\UnityEngine.dll</HintPath>
4141
</Reference>
4242
<Reference Include="UnityEngine.CoreModule">
43-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
43+
<HintPath>$(GameAssemblyPath)\UnityEngine.CoreModule.dll</HintPath>
4444
</Reference>
4545
<Reference Include="Zenject">
46-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject.dll</HintPath>
46+
<HintPath>$(PluginsPath)\Extenject\Zenject.dll</HintPath>
4747
</Reference>
4848
<Reference Include="Zenject-usage">
49-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject-usage.dll</HintPath>
49+
<HintPath>$(PluginsPath)\Extenject\Zenject-usage.dll</HintPath>
5050
</Reference>
5151
</ItemGroup>
5252

Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project>
33
<PropertyGroup>
4-
<GamePath>D:\SteamLibrary\steamapps\common\Gorilla Tag</GamePath>
4+
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Gorilla Tag</GamePath>
5+
<GameAssemblyPath>$(GamePath)\Gorilla Tag_Data\Managed</GameAssemblyPath>
6+
<BepInExAssemblyPath>$(GamePath)\BepInEx\core</BepInExAssemblyPath>
57
<PluginsPath>$(GamePath)\BepInEx\plugins</PluginsPath>
68
<ZipDir>$(SolutionDir)ReleaseZip</ZipDir>
79
</PropertyGroup>
8-
</Project>
10+
<PropertyGroup Condition="'$(CI)'=='TRUE'">
11+
<GameAssemblyPath>..\ComputerInterface\Libs</GameAssemblyPath>
12+
<BepInExAssemblyPath>..\ComputerInterface\Libs</BepInExAssemblyPath>
13+
<PluginsPath>..\ComputerInterface\Libs</PluginsPath>
14+
<WarningLevel>0</WarningLevel>
15+
</PropertyGroup>
16+
</Project>

ComputerInterface/ComputerInterface.csproj

+21-21
Original file line numberDiff line numberDiff line change
@@ -22,64 +22,64 @@
2222

2323
<ItemGroup>
2424
<Reference Include="0Harmony">
25-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\core\0Harmony.dll</HintPath>
25+
<HintPath>$(BepInExAssemblyPath)\0Harmony.dll</HintPath>
2626
</Reference>
2727
<Reference Include="Assembly-CSharp">
28-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Assembly-CSharp.dll</HintPath>
28+
<HintPath>$(GameAssemblyPath)\Assembly-CSharp.dll</HintPath>
2929
</Reference>
3030
<Reference Include="BepInEx">
31-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\core\BepInEx.dll</HintPath>
31+
<HintPath>$(BepInExAssemblyPath)\BepInEx.dll</HintPath>
3232
</Reference>
3333
<Reference Include="Bepinject">
34-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Bepinject-Auros\Bepinject.dll</HintPath>
34+
<HintPath>$(PluginsPath)\Bepinject-Auros\Bepinject.dll</HintPath>
3535
</Reference>
3636
<Reference Include="Photon3Unity3D">
37-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Photon3Unity3D.dll</HintPath>
37+
<HintPath>$(GameAssemblyPath)\Photon3Unity3D.dll</HintPath>
3838
</Reference>
3939
<Reference Include="PhotonRealtime">
40-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonRealtime.dll</HintPath>
40+
<HintPath>$(GameAssemblyPath)\PhotonRealtime.dll</HintPath>
4141
</Reference>
4242
<Reference Include="PhotonUnityNetworking">
43-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PhotonUnityNetworking.dll</HintPath>
43+
<HintPath>$(GameAssemblyPath)\PhotonUnityNetworking.dll</HintPath>
4444
</Reference>
4545
<Reference Include="PlayFab">
46-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\PlayFab.dll</HintPath>
46+
<HintPath>$(GameAssemblyPath)\PlayFab.dll</HintPath>
4747
</Reference>
4848
<Reference Include="Unity.InputSystem">
49-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Unity.InputSystem.dll</HintPath>
49+
<HintPath>$(GameAssemblyPath)\Unity.InputSystem.dll</HintPath>
5050
</Reference>
5151
<Reference Include="Unity.TextMeshPro">
52-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\ComputerInterface\Unity.TextMeshPro.dll</HintPath>
52+
<HintPath>$(PluginsPath)\ComputerInterface\Unity.TextMeshPro.dll</HintPath>
5353
</Reference>
5454
<Reference Include="Unity.XR.Interaction.Toolkit">
55-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\Unity.XR.Interaction.Toolkit.dll</HintPath>
55+
<HintPath>$(GameAssemblyPath)\Unity.XR.Interaction.Toolkit.dll</HintPath>
5656
</Reference>
5757
<Reference Include="UnityEngine">
58-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.dll</HintPath>
58+
<HintPath>$(GameAssemblyPath)\UnityEngine.dll</HintPath>
5959
</Reference>
6060
<Reference Include="UnityEngine.AssetBundleModule">
61-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
61+
<HintPath>$(GameAssemblyPath)\UnityEngine.AssetBundleModule.dll</HintPath>
6262
</Reference>
6363
<Reference Include="UnityEngine.AudioModule">
64-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
64+
<HintPath>$(GameAssemblyPath)\UnityEngine.AudioModule.dll</HintPath>
6565
</Reference>
6666
<Reference Include="UnityEngine.CoreModule">
67-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
67+
<HintPath>$(GameAssemblyPath)\UnityEngine.CoreModule.dll</HintPath>
6868
</Reference>
6969
<Reference Include="UnityEngine.ImageConversionModule">
70-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
70+
<HintPath>$(GameAssemblyPath)\UnityEngine.ImageConversionModule.dll</HintPath>
7171
</Reference>
7272
<Reference Include="UnityEngine.PhysicsModule">
73-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
73+
<HintPath>$(GameAssemblyPath)\UnityEngine.PhysicsModule.dll</HintPath>
7474
</Reference>
7575
<Reference Include="UnityEngine.UI">
76-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\Gorilla Tag_Data\Managed\UnityEngine.UI.dll</HintPath>
76+
<HintPath>$(GameAssemblyPath)\UnityEngine.UI.dll</HintPath>
7777
</Reference>
7878
<Reference Include="Zenject">
79-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject.dll</HintPath>
79+
<HintPath>$(PluginsPath)\Extenject\Zenject.dll</HintPath>
8080
</Reference>
8181
<Reference Include="Zenject-usage">
82-
<HintPath>D:\SteamLibrary\steamapps\common\Gorilla Tag\BepInEx\plugins\Extenject\Zenject-usage.dll</HintPath>
82+
<HintPath>$(PluginsPath)\Extenject\Zenject-usage.dll</HintPath>
8383
</Reference>
8484
</ItemGroup>
8585

@@ -89,4 +89,4 @@
8989
<StartArguments>-applaunch 1533390 -vrmode oculus --verbose fpfc</StartArguments>
9090
</PropertyGroup>
9191

92-
</Project>
92+
</Project>
+10-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project>
33
<PropertyGroup>
4-
<GamePath>D:\SteamLibrary\steamapps\common\Gorilla Tag</GamePath>
4+
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Gorilla Tag</GamePath>
5+
<GameAssemblyPath>$(GamePath)\Gorilla Tag_Data\Managed</GameAssemblyPath>
6+
<BepInExAssemblyPath>$(GamePath)\BepInEx\core</BepInExAssemblyPath>
57
<PluginsPath>$(GamePath)\BepInEx\plugins</PluginsPath>
68
<ZipDir>$(SolutionDir)ReleaseZip</ZipDir>
79
</PropertyGroup>
8-
</Project>
10+
<PropertyGroup Condition="'$(CI)'=='TRUE'">
11+
<GameAssemblyPath>.\Libs</GameAssemblyPath>
12+
<BepInExAssemblyPath>.\Libs</BepInExAssemblyPath>
13+
<PluginsPath>.\Libs</PluginsPath>
14+
<WarningLevel>0</WarningLevel>
15+
</PropertyGroup>
16+
</Project>

MakeRelease.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Requires -Modules @{ ModuleName="Microsoft.PowerShell.Archive"; ModuleVersion="1.2.3" }
2+
$MyInvocation.MyCommand.Path | Split-Path | Push-Location # Run from this script's directory
3+
$Name = ((ls . -filter *.csproj -recurse | sort).BaseName) | select -last 1
4+
dotnet build -c Release
5+
curl -L https://github.com/ToniMacaroni/ComputerInterface/releases/download/1.4.12/ComputerInterface.zip -o DL.zip
6+
Expand-Archive DL.zip
7+
rm DL.zip
8+
mv DL\BepInEx .
9+
rm DL
10+
cp .\ReleaseZip\BepInEx\plugins\$Name\$Name* .\BepInEx\plugins\$Name\
11+
Compress-Archive .\BepInEx\ $Name-v
12+
rmdir .\BepInEx\ -R
13+
rm ReleaseZip -R
14+
Pop-Location

0 commit comments

Comments
 (0)