-
Notifications
You must be signed in to change notification settings - Fork 18
326 lines (286 loc) · 12.6 KB
/
Build-Html-Package.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
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: Build Html Package
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
version:
description: 手动设定版本
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
os: [ windows-latest ]
#os: [ ubuntu-latest, windows-latest ]
node-version: [ 18.x ]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
with:
submodules: true
- name: SugarCube-2
uses: actions/checkout@v4
with:
repository: Lyoko-Jeremie/sugarcube-2_Vrelnir
path: SC2
ref: TS
#submodules: recursive
- name: init ModLoader
working-directory: ${{ github.workspace }}/ModLoader
run: git submodule update --init --recursive
# - name: ModLoader
# uses: actions/checkout@v4
# with:
# repository: Lyoko-Jeremie/sugarcube-2-ModLoader
# path: ModLoader
# ref: master
# submodules: recursive
# - name: DoL
# uses: actions/checkout@v4
# with:
# repository: Vrelnir/degrees-of-lewdity.git
# path: DoL
# ref: master
# github-server-url: 'https://gitgud.io'
# submodules: recursive
# /ModLoader Init =========================================
- name: Build ModLoader
working-directory: ${{ github.workspace }}/ModLoader
run: |
yarn install
yarn run ts:BeforeSC2
yarn run webpack:BeforeSC2
yarn run ts:ForSC2
yarn run webpack:insertTools
- name: Build ModLoaderGui
working-directory: ${{ github.workspace }}/ModLoader/mod/ModLoaderGui
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy ModLoaderGui
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/ModLoaderGui/ModLoaderGui.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build ImageLoaderHook
working-directory: ${{ github.workspace }}/ModLoader/mod/ImageLoaderHook
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy ImageLoaderHook
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/ImageLoaderHook/ModLoader DoL ImageLoaderHook.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build CheckGameVersion
working-directory: ${{ github.workspace }}/ModLoader/mod/CheckGameVersion
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy CheckGameVersion
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/CheckGameVersion/CheckGameVersion.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build Diff3WayMerge
working-directory: ${{ github.workspace }}/ModLoader/mod/Diff3WayMerge
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy Diff3WayMerge
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/Diff3WayMerge/Diff3WayMerge.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build ModdedClothesAddon
working-directory: ${{ github.workspace }}/ModLoader/mod/ModdedClothesAddon
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy ModdedClothesAddon
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/ModdedClothesAddon/ModdedClothesAddon.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build ReplacePatch
working-directory: ${{ github.workspace }}/ModLoader/mod/ReplacePatch
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy ReplacePatch
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/ReplacePatch/ReplacePatcher.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build TweeReplacer
working-directory: ${{ github.workspace }}/ModLoader/mod/TweeReplacer
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy TweeReplacer
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/TweeReplacer/TweeReplacer.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Build CheckDoLCompressorDictionaries
working-directory: ${{ github.workspace }}/ModLoader/mod/CheckDoLCompressorDictionaries
run: |
yarn install
yarn run build:ts
yarn run build:webpack
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json"
- name: Copy CheckDoLCompressorDictionaries
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/ModLoader/
source: ${{ github.workspace }}/ModLoader/mod/CheckDoLCompressorDictionaries/CheckDoLCompressorDictionaries.mod.zip
destBase: ${{ github.workspace }}/ModLoader/out
target: ${{ github.workspace }}/ModLoader/out
- name: Copy dist-BeforeSC2
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
source: ${{ github.workspace }}/ModLoader/dist-BeforeSC2/**/*
target: ${{ github.workspace }}/ModLoader/out/dist-BeforeSC2/
- name: Copy dist-ForSC2
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
source: ${{ github.workspace }}/ModLoader/dist-ForSC2/**/*
target: ${{ github.workspace }}/ModLoader/out/dist-ForSC2/
- name: Copy dist-insertTools
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
source: ${{ github.workspace }}/ModLoader/dist-insertTools/**/*
target: ${{ github.workspace }}/ModLoader/out/dist-insertTools/
- name: Copy README.md
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
source: ${{ github.workspace }}/ModLoader/README.md
target: ${{ github.workspace }}/ModLoader/out
# /ModLoader OK =========================================
# /SC2 Init =========================================
- name: Build SC2
working-directory: ${{ github.workspace }}/SC2
run: |
npm install
node build.js -d -u -b 2
# /SC2 OK =========================================
- name: Copy SC2 format.js
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
one: "true"
srcBase: ${{ github.workspace }}/SC2/build/twine2/sugarcube-2/
source: ${{ github.workspace }}/SC2/build/twine2/sugarcube-2/format.js
destBase: ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/
target: ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/
# /DoL Init =========================================
- name: Build DoL (Linux)
if: runner.os != 'Windows'
working-directory: ${{ github.workspace }}/DoL
run: ./compile.sh
- name: Build DoL (Win)
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}/DoL
run: ./compile.bat
# /DoL OK =========================================
# - name: Upload debug
# uses: actions/upload-artifact@v3
# with:
# name: Html debug-${{ github.sha }}
# path: |
# ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/format.js
# ${{ github.workspace }}/ModLoader/out/
- name: Inject ModLoader
working-directory: ${{ github.workspace }}/ModLoader/out
run: |
node "${{ github.workspace }}/ModLoader/out/dist-insertTools/insert2html.js" "${{ github.workspace }}/DoL/Degrees of Lewdity VERSION.html" "modList.json" "${{ github.workspace }}/ModLoader/out/dist-BeforeSC2/BeforeSC2.js"
# make package Init =========================================
- name: MKDIR
run: |
mkdir ${{ github.workspace }}/output
- name: Copy html
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/DoL/
source: ${{ github.workspace }}/DoL/Degrees of Lewdity VERSION.html.mod.html
target: ${{ github.workspace }}/output
- name: Copy style
uses: Lyoko-Jeremie/js-copy-github-action@master
with:
srcBase: ${{ github.workspace }}/DoL/
source: ${{ github.workspace }}/DoL/style.css
target: ${{ github.workspace }}/output
# - name: Copy img
# uses: Lyoko-Jeremie/js-copy-github-action@master
# with:
# srcBase: ${{ github.workspace }}/DoL/
# source: ${{ github.workspace }}/DoL/img/**/*
# target: ${{ github.workspace }}/output
- name: Copy img (Win)
if: runner.os == 'Windows'
run: copy -Path "${{ github.workspace }}/DoL/img" -Destination "${{ github.workspace }}/output" -Recurse
- name: Archive Release (Artifact)
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
filename: DoL-ModLoader-${{ github.sha }}.zip
directory: ${{ github.workspace }}/output
# make package OK =========================================
# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# name: Html Package-${{ github.sha }}
# path: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip
- name: Archive Release (Releases Manually)
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
files: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip
name: Release v${{ github.event.inputs.version }}
tag_name: v${{ github.event.inputs.version }}-${{ github.sha }}
body: Release v${{ github.event.inputs.version }}-${{ github.sha }}v
- name: Archive Release (Releases Auto)
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
files: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip
name: Auto Release (${{ github.sha }})
tag_name: auto-${{ github.sha }}
body: Auto Release (${{ github.sha }})
prerelease: true