This repository was archived by the owner on Sep 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
304 lines (263 loc) · 12.9 KB
/
release.yml
File metadata and controls
304 lines (263 loc) · 12.9 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
name: Release
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
create_release:
description: 'Create a GitHub release'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
jobs:
build-bepinex:
runs-on: ubuntu-latest
steps:
- name: Checkout BepInEx
uses: actions/checkout@v4
with:
repository: ResoniteModding/BepInEx
ref: master
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Build BepInEx
run: |
chmod +x build.sh
./build.sh
echo "BepInEx build completed"
ls -la bin/NET.CoreCLR/net9.0/
- name: Upload BepInEx artifacts
uses: actions/upload-artifact@v4
with:
name: bepinex-build
path: bin/NET.CoreCLR/net9.0/
build-bepisloader:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Build BepisLoader
run: |
dotnet build -c Release
echo "BepisLoader build completed"
ls -la bin/Release/net9.0/
- name: Upload BepisLoader artifacts
uses: actions/upload-artifact@v4
with:
name: bepisloader-build
path: bin/Release/net9.0/
download-resoniteshim:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Download ResoniteShim from NuGet
run: |
# Query the NuGet API for the latest version
PACKAGE_ID="ResoniteModding.BepInExResoniteShim"
INDEX_URL="https://nuget-modding.resonite.net/v3/index.json"
# Get the service index
SERVICE_INDEX=$(curl -s $INDEX_URL)
# Get the package metadata URL
PACKAGE_BASE=$(echo $SERVICE_INDEX | jq -r '.resources[] | select(."@type" | contains("PackageBaseAddress")) | ."@id"')
# Get registration URL for version discovery
REGISTRATION_BASE=$(echo $SERVICE_INDEX | jq -r '.resources[] | select(."@type" | contains("RegistrationsBaseUrl")) | ."@id"')
# Get the latest version
VERSIONS_URL="${REGISTRATION_BASE}${PACKAGE_ID,,}/index.json"
LATEST_VERSION=$(curl -s $VERSIONS_URL | jq -r '.items[0].items | last | .catalogEntry.version')
echo "Latest version: $LATEST_VERSION"
# Download the nupkg file
DOWNLOAD_URL="${PACKAGE_BASE}${PACKAGE_ID,,}/${LATEST_VERSION}/${PACKAGE_ID,,}.${LATEST_VERSION}.nupkg"
wget -q -O package.nupkg "$DOWNLOAD_URL"
# Extract the DLL from the nupkg (which is just a zip file)
unzip -q package.nupkg
# Find and move the DLL
find . -name "BepInExResoniteShim.dll" -exec cp {} . \;
echo "ResoniteShim DLL downloaded successfully"
ls -la BepInExResoniteShim.dll
- name: Upload ResoniteShim artifacts
uses: actions/upload-artifact@v4
with:
name: resoniteshim-build
path: BepInExResoniteShim.dll
release:
needs: [build-bepinex, build-bepisloader, download-resoniteshim]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Collect build info
id: info
run: |
SHA_SHORT=$(git rev-parse --short HEAD)
echo "sha_short=$SHA_SHORT" >> $GITHUB_OUTPUT
VERSION=$(grep -oP '(?<=<Version>)[^<]+' BepisLoader.csproj)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version found: $VERSION"
- name: Download BepInEx artifacts
uses: actions/download-artifact@v4
with:
name: bepinex-build
path: bepinex-artifacts
- name: Download BepisLoader artifacts
uses: actions/download-artifact@v4
with:
name: bepisloader-build
path: bepisloader-artifacts
- name: Download ResoniteShim artifacts
uses: actions/download-artifact@v4
with:
name: resoniteshim-build
path: resoniteshim-artifacts
- name: Prepare common release files
run: |
# Create directory structure for both platforms
for platform in linux windows; do
mkdir -p release/$platform
mkdir -p release/$platform/BepInEx/core
mkdir -p release/$platform/BepInEx/patchers
mkdir -p release/$platform/BepInEx/plugins
# Copy BepisLoader files
cp bepisloader-artifacts/BepisLoader.dll release/$platform/
cp bepisloader-artifacts/BepisLoader.pdb release/$platform/
cp bepisloader-artifacts/BepisLoader.deps.json release/$platform/
# Copy BepInEx core files
cp bepinex-artifacts/*.dll release/$platform/BepInEx/core/ || true
cp bepinex-artifacts/*.pdb release/$platform/BepInEx/core/ || true
cp bepinex-artifacts/*.xml release/$platform/BepInEx/core/ || true
cp bepinex-artifacts/*.json release/$platform/BepInEx/core/ || true
# Copy ResoniteShim to plugins
cp resoniteshim-artifacts/BepInExResoniteShim.dll release/$platform/BepInEx/plugins/
done
echo "Common files prepared for both platforms"
- name: Configure Linux release
run: |
# Create Linux-specific runtimeconfig.json
cat > release/linux/BepisLoader.runtimeconfig.json << 'EOF'
{
"runtimeOptions": {
"tfm": "net9.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
}
],
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
EOF
# Create Linux zip
cd release/linux
zip -r ../BepisLoader-full-linux.zip .
cd ../..
echo "Linux release created"
- name: Configure Windows release
run: |
# Create Windows-specific runtimeconfig.json with WindowsDesktop.App
cat > release/windows/BepisLoader.runtimeconfig.json << 'EOF'
{
"runtimeOptions": {
"tfm": "net9.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "9.0.0"
}
],
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
EOF
# Add hookfxr files from lib/hostfxr directory
cp lib/hostfxr/hostfxr.dll release/windows/
cp lib/hostfxr/hostfxr.pdb release/windows/
cp lib/hostfxr/hookfxr.ini release/windows/
# Create Windows zip
cd release/windows
zip -r ../BepisLoader-full-windows.zip .
cd ../..
echo "Windows release created"
- name: Check if release exists
id: check_release
run: |
TAG_NAME="${{ steps.info.outputs.version }}"
# Check if a release exists for this tag
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
echo "Release $TAG_NAME already exists"
echo "release_exists=true" >> $GITHUB_OUTPUT
else
echo "Release $TAG_NAME does not exist"
echo "release_exists=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Git Tag
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
TAG_NAME="${{ steps.info.outputs.version }}"
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "Tag $TAG_NAME already exists"
else
echo "Creating tag $TAG_NAME"
git config user.name github-actions
git config user.email [email protected]
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
git push origin "$TAG_NAME"
fi
- name: Create GitHub Release
if: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')) && steps.check_release.outputs.release_exists != 'true' }}
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
generate_release_notes: true
fail_on_unmatched_files: true
name: ${{ steps.info.outputs.version }}
tag_name: ${{ steps.info.outputs.version }}
target_commitish: ${{ github.sha }}
append_body: |
### Windows Installation
1. Extract the zip over your Resonite folder
2. Launch Resonite.exe
### Linux Installation
1. Extract the zip over your Resonite folder
2. Change LinuxBootstrap.sh to launch `BepisLoader.dll` instead of `Renderite.Host.dll`
(This needs to be re-done every time Resonite updates)
3. Launch Resonite
files: |
release/BepisLoader-full-windows.zip
release/BepisLoader-full-linux.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release-packages
path: |
release/BepisLoader-full-windows.zip
release/BepisLoader-full-linux.zip