Lua for Watcom #206
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| run: | | |
| export INCLUDE=$WATCOM/h | |
| wmake -f wm_dos16.mak | |
| - name: Build Lua for DOS4GW 32-bit Extender | |
| run: | | |
| export INCLUDE=$WATCOM/h | |
| wmake -f wm_dos4g.mak | |
| - name: Build Lua for Windows 95 | |
| run: | | |
| export INCLUDE=$WATCOM/h/nt:$WATCOM/h | |
| wmake -f wm_winnt.mak | |
| - name: Build Lua for OS/2 16-bit | |
| run: | | |
| export INCLUDE=$WATCOM/h/os2:$WATCOM/h | |
| wmake -f wm_os216.mak | |
| - name: Build Lua for OS/2 32-bit | |
| run: | | |
| export INCLUDE=$WATCOM/h/os2:$WATCOM/h | |
| 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: 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)" | |
| - 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)" | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'Lua Binaries' | |
| 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="Lua Binaries/$(ls WLE*.zip)" | |
| sed -i "s/{{WLE}}/${name}/g" .github/workflows/notes.md | |
| name="Lua Binaries/$(ls WLI*.zip)" | |
| 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 \ | |
| "Lua Binaries/*.zip" |