Skip to content

Commit 2cf0877

Browse files
committed
Add dynamic release notes generation for Lua Watcom builds
Updated the workflow to dynamically generate release notes with a formatted date. Integrated a template replacement step and changed the release creation to use the generated notes file.
1 parent 856ae8b commit 2cf0877

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/LuaWatcom.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,27 @@ jobs:
116116
- name: Download Artifacts
117117
uses: actions/download-artifact@v4
118118

119+
- name: Generate Release Notes
120+
run: |
121+
input_date="$TAG_NAME"
122+
day=$(date -d "$input_date" '+%-d')
123+
month=$(date -d "$input_date" '+%B')
124+
year=$(date -d "$input_date" '+%Y')
125+
126+
if [[ $day -eq 11 || $day -eq 12 || $day -eq 13 ]]; then
127+
suffix="th"
128+
else
129+
case $((day % 10)) in
130+
1) suffix="st" ;;
131+
2) suffix="nd" ;;
132+
3) suffix="rd" ;;
133+
*) suffix="th" ;;
134+
esac
135+
fi
136+
137+
formatted_date="${day}${suffix} of ${month} ${year}"
138+
sed -i "s/{{DATE}}/${formatted_date}/g" .github/workflows/notes.md
139+
119140
- name: Create Draft Release
120141
env:
121142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -124,6 +145,6 @@ jobs:
124145
gh release create "$TAG_NAME" \
125146
--draft \
126147
--title "$TAG_NAME" \
127-
--notes "Lua for Watcom builds from $TAG_NAME" \
148+
--notes-file .github/workflows/notes.md \
128149
"Lua Binaries/Lua Exe.zip#Lua Exe.zip" \
129150
"Lua Binaries/Lua Ima.zip#Lua Ima.zip"

.github/workflows/notes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Lua for Watcom builds from {{DATE}}
2+
3+
### File contents:
4+
5+
- `Lua Exe.zip`: Zip file containing binaries for each platform
6+
- `Lua Ima.zip`: Zip files containing two floppy disk images (useful for emulators)
7+
- 1.44mb disk image containing binaries for each platform
8+
- 160kb disk image containing just `LUA16.EXE`
9+
10+
Check [binary native targets](https://github.com/Lethja/lua-watcom#binary-native-targets)
11+
and [binary compatibilty matrix](https://github.com/Lethja/lua-watcom#binary-compatibility-matrix)
12+
to see which executable(s) can be used on your system.

0 commit comments

Comments
 (0)