-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (162 loc) · 7.29 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
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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
# Build flow:
# https GET https://gtfo.thunderstore.io/api/experimental/package/BepInEx/BepInExPack_GTFO/3.2.1/
#
name: .NET
on:
push:
branches: ["main"]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
# Get AutogenRundown mod version
- name: Get version
id: version
run: echo "version=$(jq -r .version_number manifest.json)" >> "$GITHUB_OUTPUT"
# Download all manifest dependencies from Thunderstore.
- id: deps
name: List mod dependencies
run: jq .dependencies ${{ github.workspace }}/manifest.json > .deps.json
- uses: actions/cache@v4
id: thunderstore-cache
name: Cache thunderstore dependencies
with:
path: deps/*.zip
key: ${{ runner.os }}-thunderstore-${{ hashFiles('.deps.json') }}
- uses: actions/github-script@v6
name: Download thunderstore dependencies
if: steps.thunderstore-cache.outputs.cache-hit != 'true'
with:
script: |
const script = require("${{ github.workspace }}/.github/actions/thunderstore-download.js");
script({ github, context, core, glob, io, exec, fetch, require });
- name: Unzip thunderstore dependencies
run: |
echo ":: Extracting dependencies";
for z in deps/*.zip; do
echo "::group:: -> $z";
unzip "$z" -d "${z%.zip}";
echo "::endgroup::";
done
# Test thunderstore-toolkit
- name: Test thunderstore-toolkit
uses: brgmnn/thunderstore-toolkit@v0.4.0
with:
command: gen-manifest
toml-path: ${{ github.workspace }}/thunderstore.toml
# Build the mod.
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
dotnet build --no-restore \
--configuration Release \
--property:Debug=false
# Run the unit tests
- name: Test
if: false
run: |
dotnet test --no-build \
--configuration Release \
--property:Debug=false \
--verbosity normal
# Package the mod.
- uses: actions/upload-artifact@v4
with:
name: AutogenRundown_${{ steps.version.outputs.version }}
path: ${{ github.workspace }}/build/*
# Generates a Zip file that can be installed manually without a mod manager
manual_package:
name: Package manual install
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Get AutogenRundown mod version
- name: Get version
id: version
run: echo "version=$(jq -r .version_number manifest.json)" >> "$GITHUB_OUTPUT"
# Download all manifest dependencies from Thunderstore.
- id: deps
name: List mod dependencies
run: jq .dependencies ${{ github.workspace }}/manifest.json > .deps.json
- uses: actions/cache@v4
id: thunderstore-cache
name: Cache thunderstore dependencies
with:
path: deps/*.zip
key: ${{ runner.os }}-thunderstore-${{ hashFiles('.deps.json') }}
- uses: actions/github-script@v6
name: Download thunderstore dependencies
if: steps.thunderstore-cache.outputs.cache-hit != 'true'
with:
script: |
const script = require("${{ github.workspace }}/.github/actions/thunderstore-download.js");
script({ github, context, core, glob, io, exec, fetch, require });
- name: Unzip thunderstore dependencies
run: |
echo ":: Extracting dependencies";
for z in deps/*.zip; do
echo "::group:: -> $z";
unzip "$z" -d "${z%.zip}";
echo "::endgroup::";
done
# Download AutogenRundown build
- uses: actions/download-artifact@v4
with:
name: AutogenRundown_${{ steps.version.outputs.version }}
path: ${{ github.workspace }}/autogen
- name: Build package
run: |
mkdir build
# BepInEx
mv deps/BepInEx-BepInExPack_GTFO/BepInExPack_GTFO build/AutogenRundown_GTFO
mkdir -p build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles
# ====== Dependency Mods ======
# --- MTFO
mv deps/dakkhuza-MTFO build/AutogenRundown_GTFO/BepInEx/plugins/
# --- Extra Objective Setup and friends
mv deps/Inas07-ExtraObjectiveSetup/plugins build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-ExtraObjectiveSetup
mv deps/Inas07-ExtraObjectiveSetup/* build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-ExtraObjectiveSetup/
mv deps/Inas07-EOSExt_Reactor/plugins build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-EOSExt_Reactor
mv deps/Inas07-EOSExt_Reactor/* build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-EOSExt_Reactor/
# --- LocalProgression
mv deps/Inas07-LocalProgression/plugins build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-LocalProgression
mv deps/Inas07-LocalProgression/Assets/AssetBundles/* build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles/
mv deps/Inas07-LocalProgression/* build/AutogenRundown_GTFO/BepInEx/plugins/Inas07-LocalProgression/
# ====== Custom Geomorphs ======
# --- Daks Geos
mkdir build/AutogenRundown_GTFO/BepInEx/plugins/dakkhuza-DakGeos
mv deps/dakkhuza-DakGeos/config/Assets/AssetBundles/* build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles/
mv deps/dakkhuza-DakGeos/* build/AutogenRundown_GTFO/BepInEx/plugins/dakkhuza-DakGeos/
# --- donan3967 geo pack 1
mkdir build/AutogenRundown_GTFO/BepInEx/plugins/donan3967-donan3967_geo_pack_1
mv deps/donan3967-donan3967_geo_pack_1/Assets/AssetBundles/* build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles/
mv deps/donan3967-donan3967_geo_pack_1/* build/AutogenRundown_GTFO/BepInEx/plugins/donan3967-donan3967_geo_pack_1/
# --- FlowGeos
mv deps/Flowaria-FlowGeos/plugins build/AutogenRundown_GTFO/BepInEx/plugins/Flowaria-FlowGeos
mv deps/Flowaria-FlowGeos/Assets/AssetBundles/* build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles/
mv deps/Flowaria-FlowGeos/* build/AutogenRundown_GTFO/BepInEx/plugins/Flowaria-FlowGeos/
# --- CheeseGeos
mkdir build/AutogenRundown_GTFO/BepInEx/plugins/Red_Leicester_Cheese-CheeseGeos
mv deps/Red_Leicester_Cheese-CheeseGeos/Assets/AssetBundles/* build/AutogenRundown_GTFO/BepInEx/Assets/AssetBundles/
mv deps/Red_Leicester_Cheese-CheeseGeos/* build/AutogenRundown_GTFO/BepInEx/plugins/Red_Leicester_Cheese-CheeseGeos/
# Custom config
cp manual-install/BepInEx.cfg build/AutogenRundown_GTFO/BepInEx/config/
# AutogenRundown
mv autogen build/AutogenRundown_GTFO/BepInEx/plugins/the_tavern-AutogenRundown
# Manual install docs
cp docs/MANUAL_INSTALL_README.txt build/README.txt
# Package the manual install mod
- uses: actions/upload-artifact@v4
with:
name: AutogenRundown_manual_install_${{ steps.version.outputs.version }}
path: ${{ github.workspace }}/build/*