-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (95 loc) · 3.35 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: AutoBuild .NET
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
~/.cache/bepinex
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: |
dotnet --info
sudo apt update
sudo apt install wget unzip -y
- name: Download and Unzip BepInEx
run: |
wget https://builds.bepinex.dev/projects/bepinex_be/697/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.697%2B5362580.zip -O BepInEx.zip
unzip BepInEx.zip -d ./Release/
sudo chmod -R 777 ./Release
- name: Download and Unzip ExtraData
run: |
wget https://raw.githubusercontent.com/mxyx-club/ExtraData/main/ExtraData.zip -O ExtraData.zip
unzip ExtraData.zip -d ./Release/
- name: Download Reactor
run: wget https://github.com/NuclearPowered/Reactor/releases/download/2.2.0/Reactor.dll -P ./Release/BepInEx/plugins
- name: Set Build Configuration
id: set-config
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "config=Release" >> $GITHUB_ENV
else
echo "config=Beta" >> $GITHUB_ENV
fi
- name: Build
run: dotnet build TheOtherRoles/TheOtherRoles.csproj --configuration ${{ env.config }} --output ./Release/BepInEx/plugins
- name: Cleanup
run: |
rm -rf ./Release/BepInEx/plugins/TheOtherUs.deps.json
rm -rf ./Release/BepInEx/plugins/TheOtherUs.pdb
rm -rf ./Release/changelog.txt
- name: Upload TheOtherUsDll
uses: actions/[email protected]
with:
name: TheOtherUs.dll
path: ./Release/BepInEx/plugins/TheOtherUs.dll
- name: Upload TheOtherUs
uses: actions/[email protected]
with:
name: TheOtherUs
path: ./Release/
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: TheOtherUs
- name: Compress subdirectories
run: |
ls -R
zip -q -r TheOtherUs.zip *
mv ./BepInEx/plugins/TheOtherUs.dll ./
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Clone Changes Log
run: |
wget https://raw.githubusercontent.com/mxyx-club/TheOtherUs-Edited/v${{ env.VERSION }}/CHANGELOG.md -O CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: "TheOtherUs-Edited v${{ env.VERSION }}"
body_path: CHANGELOG.md
files: |
TheOtherUs.dll
./TheOtherUs.zip
draft: false
prerelease: false