-
Notifications
You must be signed in to change notification settings - Fork 2
380 lines (337 loc) · 12.1 KB
/
Copy pathbuild-pd-curses-mod.yml
File metadata and controls
380 lines (337 loc) · 12.1 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
name: 🐍 Refresh PDCursesMod
on:
workflow_dispatch:
schedule:
- cron: "0 9 1 1-12 *"
jobs:
raspios_lite-arm:
runs-on: ubuntu-latest
name: 🐧 Raspberry Pi OS Lite ARM
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: Bill-Gray/PDCursesMod
ref: refs/heads/master
- name: 🛠️ Build library
id: build-library
uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite:latest
bind_mount_repository: yes
commands: |
cd vt
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-vt-arm.so
cd ../fb
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-fb-arm.so
- name: ⬆️ Upload artifacts (VT)
id: upload-artifacts-vt
uses: actions/upload-artifact@v4
with:
name: libraries-raspios_lite-arm-vt
path: "vt/*.so"
if-no-files-found: error
- name: ⬆️ Upload artifacts (FB)
id: upload-artifacts-fb
uses: actions/upload-artifact@v4
with:
name: libraries-raspios_lite-arm-fb
path: "fb/*.so"
if-no-files-found: error
raspios_lite-arm64:
runs-on: ubuntu-latest
name: 🐧 Raspberry Pi OS Lite ARM
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: Bill-Gray/PDCursesMod
ref: refs/heads/master
- name: 🛠️ Build library
id: build-library
uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
bind_mount_repository: yes
commands: |
cd vt
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-vt-arm64.so
cd ../fb
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-fb-arm64.so
- name: ⬆️ Upload artifacts (VT)
id: upload-artifacts-vt
uses: actions/upload-artifact@v4
with:
name: libraries-raspios_lite-arm64-vt
path: "vt/*.so"
if-no-files-found: error
- name: ⬆️ Upload artifacts (FB)
id: upload-artifacts-fb
uses: actions/upload-artifact@v4
with:
name: libraries-raspios_lite-arm64-fb
path: "fb/*.so"
if-no-files-found: error
ubuntu-x64:
runs-on: ubuntu-latest
name: 🐧 Ubuntu x64
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: Bill-Gray/PDCursesMod
ref: refs/heads/master
- name: Install SDL1 and SDL2
run: |
sudo apt update
sudo apt install libsdl1.2-dev libsdl-ttf2.0-dev libsdl2-dev libsdl2-ttf-dev
- name: 🛠️ Build library (VT)
id: build-library-vt
run: |
cd vt
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-vt-x64.so
- name: 🛠️ Build library (FB)
id: build-library-fb
run: |
cd fb
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-fb-x64.so
- name: 🛠️ Build library (SDL1)
id: build-library-sdl1
run: |
cd sdl1
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-sdl1-x64.so
- name: 🛠️ Build library (SDL2)
id: build-library-sdl2
run: |
cd sdl2
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.so libpdcursesmod-sdl2-x64.so
- name: ⬆️ Upload artifacts (VT)
id: upload-artifacts-vt
uses: actions/upload-artifact@v4
with:
name: libraries-ubuntu-x64-vt
path: "vt/*.so"
if-no-files-found: error
- name: ⬆️ Upload artifacts (FB)
id: upload-artifacts-fb
uses: actions/upload-artifact@v4
with:
name: libraries-ubuntu-x64-fb
path: "fb/*.so"
if-no-files-found: error
- name: ⬆️ Upload artifacts (SDL1)
id: upload-artifacts-sdl1
uses: actions/upload-artifact@v4
with:
name: libraries-ubuntu-x64-sdl1
path: "sdl1/*.so"
if-no-files-found: error
- name: ⬆️ Upload artifacts (SDL2)
id: upload-artifacts-sdl2
uses: actions/upload-artifact@v4
with:
name: libraries-ubuntu-x64-sdl2
path: "sdl2/*.so"
if-no-files-found: error
macos-x64:
runs-on: macOS-latest
name: 🍎 macOS x64
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: Bill-Gray/PDCursesMod
ref: refs/heads/master
- name: ⚙️ Setup environment
run: |
brew install sdl2 sdl2_ttf
- name: 🛠️ Build library (VT)
id: build-library-vt
run: |
cd vt
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.dylib libpdcursesmod-vt-x64.dylib
- name: 🛠️ Build library (SDL2)
id: build-library-sdl2
run: |
cd sdl2
make WIDE=Y DLL=Y CHTYPE_32=Y
mv libpdcurses.dylib libpdcursesmod-sdl2-x64.dylib
- name: ⬆️ Upload artifacts (VT)
id: upload-artifacts-vt
uses: actions/upload-artifact@v4
with:
name: libraries-macos-x64-vt
path: "vt/*.dylib"
if-no-files-found: error
- name: ⬆️ Upload artifacts (SDL2)
id: upload-artifacts-sdl2
uses: actions/upload-artifact@v4
with:
name: libraries-macos-x64-sdl2
path: "sdl2/*.dylib"
if-no-files-found: error
windows-x64:
name: 🪟 Windows x64
runs-on: windows-2022
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: Bill-Gray/PDCursesMod
ref: refs/heads/master
- name: ⚙️ Setup environment
id: setup-environment
uses: ilammy/msvc-dev-cmd@v1
- name: 🛠️ Build library (WinGUI)
id: build-library-wingui
run: |
cd wingui
nmake WIDE=Y DLL=Y CHTYPE_32=Y -f Makefile.vc
ren pdcurses.dll libpdcursesmod-wingui-x64.dll
- name: 🛠️ Build library (WinCon)
id: build-library-wincon
run: |
cd wincon
nmake WIDE=Y DLL=Y CHTYPE_32=Y -f Makefile.vc
ren pdcurses.dll libpdcursesmod-wincon-x64.dll
- name: 🛠️ Build library (VT)
id: build-library-vt
run: |
cd vt
nmake WIDE=Y DLL=Y CHTYPE_32=Y -f Makefile.vc
ren pdcurses.dll libpdcursesmod-vt-x64.dll
- name: ⬆️ Upload artifacts (WinGUI)
id: upload-artifacts-wingui
uses: actions/upload-artifact@v4
with:
name: libraries-windows-x64-wingui
path: "wingui/*.dll"
if-no-files-found: error
- name: ⬆️ Upload artifacts (WinCon)
id: upload-artifacts-wincon
uses: actions/upload-artifact@v4
with:
name: libraries-windows-x64-wincon
path: "wincon/*.dll"
if-no-files-found: error
- name: ⬆️ Upload artifacts (VT)
id: upload-artifacts-vt
uses: actions/upload-artifact@v4
with:
name: libraries-windows-x64-vt
path: "vt/*.dll"
if-no-files-found: error
create-pr:
name: 📝 Create pull request
runs-on: ubuntu-latest
needs:
[ubuntu-x64, macos-x64, windows-x64, raspios_lite-arm, raspios_lite-arm64]
outputs:
pr_created: ${{ steps.create-pull-request.outputs.pull-request-number != '' }}
pr_number: ${{ steps.create-pull-request.outputs.pull-request-number }}
files_changed: ${{ steps.check-changes.outputs.files_changed }}
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@v4
- name: 📥 Download artifacts
id: download-artifact
uses: actions/download-artifact@v4.1.7
with:
pattern: libraries*
merge-multiple: true
path: lib/pdcursesmod
- name: 🔍 Check for changes
id: check-changes
run: |
if git diff --quiet HEAD -- lib/pdcursesmod/; then
echo "files_changed=false" >> $GITHUB_OUTPUT
else
echo "files_changed=true" >> $GITHUB_OUTPUT
fi
- name: 🔼 Bump version
id: bump-version
if: steps.check-changes.outputs.files_changed == 'true'
run: |
sed -i "s|<PdCursesModVersion>.*</PdCursesModVersion>|<PdCursesModVersion>$(shell date +%Y.%m.%d)</PdCursesModVersion>|" NativeLibraries/Sharpie.NativeLibraries.PdCursesMod.csproj
- name: 📝 Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@v6
with:
commit-message: (chore) Update PDCursesMod native libraries.
committer: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
author: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
title: Update PDCursesMod native library to latest master.
body: This is an auto-generated PR with native library updates.
delete-branch: true
labels: dependencies
assignees: pavkam
branch: pdcursesmod-lib-update
summary:
name: ✔︎ Generate summary
runs-on: ubuntu-latest
needs: [ubuntu-x64, macos-x64, windows-x64, raspios_lite-arm, raspios_lite-arm64, create-pr]
if: always()
steps:
- name: 📝 Create summary
id: create-summary
shell: bash
run: |
echo "## 🐍 PDCursesMod Library Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status | Library Changes |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|----------------|" >> $GITHUB_STEP_SUMMARY
# Check each build job status
if [ "${{ needs.ubuntu-x64.result }}" = "success" ]; then
echo "| Ubuntu x64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Ubuntu x64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.macos-x64.result }}" = "success" ]; then
echo "| macOS x64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| macOS x64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.windows-x64.result }}" = "success" ]; then
echo "| Windows x64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Windows x64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.raspios_lite-arm.result }}" = "success" ]; then
echo "| Raspberry Pi OS ARM | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Raspberry Pi OS ARM | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.raspios_lite-arm64.result }}" = "success" ]; then
echo "| Raspberry Pi OS ARM64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Raspberry Pi OS ARM64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📝 Pull Request Status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Check if PR was created and files changed
if [ "${{ needs.create-pr.outputs.pr_created }}" = "true" ]; then
if [ "${{ needs.create-pr.outputs.files_changed }}" = "true" ]; then
echo "| Status | 🔄 PR Created with Changes |" >> $GITHUB_STEP_SUMMARY
echo "| PR Number | #${{ needs.create-pr.outputs.pr_number }} |" >> $GITHUB_STEP_SUMMARY
else
echo "| Status | ⏭️ No Changes - No PR Created |" >> $GITHUB_STEP_SUMMARY
fi
else
echo "| Status | ❌ PR Creation Failed |" >> $GITHUB_STEP_SUMMARY
fi