-
Notifications
You must be signed in to change notification settings - Fork 2
170 lines (140 loc) · 4.69 KB
/
LuaWatcom.yml
File metadata and controls
170 lines (140 loc) · 4.69 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
name: Lua for Watcom
on: push
jobs:
Watcom:
name: Build Lua with Open Watcom
runs-on: ubuntu-latest
steps:
- uses: open-watcom/setup-watcom@v0
with:
version: "1.9"
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install -y gcc libreadline-dev lua5.4 make mtools zip
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Test Lua Core Demo Scripts function
run: |
lua demo/core/README.LUA
lua demo/core/BENCH.LUA
lua demo/core/S256SUM.LUA demo/core/S256SUM.LUA
- name: Patch Lua Source Code for Open Watcom
run: |
patch -p0 -i lua.pat
- name: Check GCC can build Lua after patches
run: |
cd lua
make -j`nproc`
cd ..
- name: Build Lua for DOS 16-bit
env:
INCLUDE: "${{ env.WATCOM }}/h"
run: |
wmake -f wm_dos16.mak
- name: Build Lua for DOS4GW 32-bit Extender
env:
INCLUDE: "${{ env.WATCOM }}/h"
run: |
wmake -f wm_dos4g.mak
- name: Build Lua for Windows 95
env:
INCLUDE: "${{ env.WATCOM }}/h/nt:${{ env.WATCOM }}/h"
run: |
wmake -f wm_winnt.mak
- name: Build Lua for OS/2 16-bit
env:
INCLUDE: "${{ env.WATCOM }}/h/os2:${{ env.WATCOM }}/h"
run: |
wmake -f wm_os216.mak
- name: Build Lua for OS/2 32-bit
env:
INCLUDE: "${{ env.WATCOM }}/h/os2:${{ env.WATCOM }}/h"
run: |
wmake -f wm_os232.mak
- name: Copy DOS4GW Binary
run: |
cp $WATCOM/binw/dos4gw.exe dist/bin/DOS4GW.EXE
- name: Ensure Lua Scripts Have CR/LF Line Endings
run: |
lua demo/xtra/DOSFREN.LUA demo/core/*.LUA demo/xtra/*.LUA
- name: Set constant time information on PE header
run: |
lua demo/xtra/PE95TIME.LUA dist/bin/LUANT.EXE
- name: Create Binaries Zip
run: |
zip -j9 --DOS-names dist/LuaExe.zip dist/bin/*.EXE demo/core/*.LUA demo/xtra/*.LUA
mv dist/LuaExe.zip "dist/WLE$(sha256sum dist/LuaExe.zip | awk '{print $1}' | cut -c1-5).zip"
- name: UPX Binary Compression
uses: crazy-max/ghaction-upx@v3
with:
version: latest
args: -9 --8086
files: |
dist/bin/LUA16.EXE
dist/bin/LUA4G.EXE
dist/bin/LUANT.EXE
- name: Create 160k 16-bit DOS Floppy Diskette Image
run: |
mformat -C -i dist/Lua160k.ima -v "LUA DOS" -f 160
mcopy -i dist/Lua160k.ima dist/bin/LUA16.EXE demo/core/*.LUA ::
- name: Create 1.4M Multi-Platform Floppy Diskette Image
run: |
mformat -C -i dist/LuaMulti.ima -v "LUA MULTIOS" -f 1440
mcopy -i dist/LuaMulti.ima dist/bin/*.EXE demo/core/*.LUA demo/xtra/*.LUA ::
- name: Create Floppy Disk Images Zip
run: |
zip -j9 --DOS-names dist/LuaIma.zip dist/*.ima
mv dist/LuaIma.zip "dist/WLI$(sha256sum dist/LuaIma.zip | awk '{print $1}' | cut -c1-5).zip"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: 'LuaBin'
path: dist/*.zip
compression-level: 0
Draft:
name: Draft Release
needs: Watcom
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/202')
permissions:
contents: write
actions: read
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Generate Release Notes
run: |
input_date="$TAG_NAME"
day=$(date -d "$input_date" '+%-d')
month=$(date -d "$input_date" '+%B')
year=$(date -d "$input_date" '+%Y')
if [[ $day -eq 11 || $day -eq 12 || $day -eq 13 ]]; then
suffix="th"
else
case $((day % 10)) in
1) suffix="st" ;;
2) suffix="nd" ;;
3) suffix="rd" ;;
*) suffix="th" ;;
esac
fi
formatted_date="${day}${suffix} of ${month} ${year}"
sed -i "s/{{DATE}}/${formatted_date}/g" .github/workflows/notes.md
name="$(ls LuaBin/WLE*.zip | xargs -n 1 basename)"
sed -i "s/{{WLE}}/${name}/g" .github/workflows/notes.md
name="$(ls LuaBin/WLI*.zip | xargs -n 1 basename)"
sed -i "s/{{WLI}}/${name}/g" .github/workflows/notes.md
- name: Create Draft Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}" # Extract the tag name
gh release create "$TAG_NAME" \
--draft \
--title "$TAG_NAME" \
--notes-file .github/workflows/notes.md \
"LuaBin/*.zip"