Refactored PE95TIME.LUA script to have a file size under 1536 bytes…
#168
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 | |
| 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" |