Skip to content

Commit 9974803

Browse files
Update release-binaries.yml
1 parent d2fba32 commit 9974803

1 file changed

Lines changed: 81 additions & 5 deletions

File tree

β€Ž.github/workflows/release-binaries.ymlβ€Ž

Lines changed: 81 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build & Release Bangen
33
on:
44
workflow_dispatch:
55
push:
6+
branches:
7+
- main
68
paths:
79
- "pyproject.toml"
810

@@ -35,7 +37,7 @@ jobs:
3537
EOF
3638
)
3739
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
38-
echo "tag=$VERSION" >> "$GITHUB_OUTPUT"
40+
echo "tag=$VERSION" >> "$GITHUB_OUTPUT"
3941
4042
- name: Abort if tag already exists
4143
run: |
@@ -80,7 +82,7 @@ jobs:
8082
path: |
8183
~/.cache/pip
8284
~/AppData/Local/pip/Cache
83-
key: pip-${{ runner.os }}-${{ hashFiles('requirements*.txt') }}
85+
key: pip-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
8486
restore-keys: pip-${{ runner.os }}-
8587

8688
- name: Cache Nuitka
@@ -102,7 +104,7 @@ jobs:
102104
shell: bash
103105
run: |
104106
python -m pip install -U pip wheel nuitka zstandard
105-
[[ -f requirements.txt ]] && pip install -r requirements.txt || true
107+
pip install ".[all]"
106108
107109
- name: Build with Nuitka
108110
shell: bash
@@ -115,7 +117,12 @@ jobs:
115117
--assume-yes-for-downloads \
116118
--output-dir=build \
117119
--output-filename=bangen \
118-
--nofollow-import-to=tkinter,unittest,test,distutils,setuptools,pkg_resources \
120+
--include-package=bangen \
121+
--include-package=pyfiglet \
122+
--include-package=rich \
123+
--include-package=PIL \
124+
--include-package=typer \
125+
--nofollow-import-to=tkinter,unittest,test,distutils,setuptools,pkg_resources,email,http,html,xml,xmlrpc \
119126
--python-flag=no_asserts,no_docstrings,isolated \
120127
--onefile-tempdir-spec="{CACHE_DIR}/bangen/$VERSION" \
121128
_entry.py
@@ -150,6 +157,10 @@ jobs:
150157
contents: write
151158

152159
steps:
160+
- uses: actions/checkout@v4
161+
with:
162+
fetch-depth: 0
163+
153164
- uses: actions/download-artifact@v4
154165
with:
155166
path: artifacts
@@ -160,8 +171,73 @@ jobs:
160171
cd artifacts
161172
sha256sum * > SHA256SUMS.txt
162173
174+
- name: Build release notes
175+
id: notes
176+
env:
177+
VERSION: ${{ needs.tag.outputs.version }}
178+
run: |
179+
PREV_TAG=$(git tag --sort=-version:refname | grep -v "^$VERSION$" | head -1)
180+
181+
if [[ -n "$PREV_TAG" ]]; then
182+
COMMITS=$(git log "$PREV_TAG"..HEAD --pretty=format:"- %s (%h)" --no-merges)
183+
COMPARE_URL="https://github.com/${{ github.repository }}/compare/$PREV_TAG...$VERSION"
184+
SINCE_LINE="> Changes since \`$PREV_TAG\` Β· [Full diff]($COMPARE_URL)"
185+
else
186+
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
187+
SINCE_LINE="> Initial release"
188+
fi
189+
190+
# Bucket commits by conventional prefix
191+
FEATS=$(echo "$COMMITS" | grep -E "^- feat" | sed 's/^- feat[^:]*: /- /' || true)
192+
FIXES=$(echo "$COMMITS" | grep -E "^- fix" | sed 's/^- fix[^:]*: /- /' || true)
193+
CHORES=$(echo "$COMMITS" | grep -E "^- (chore|refactor|perf|build|ci)" | sed 's/^- [^:]*: /- /' || true)
194+
OTHER=$(echo "$COMMITS" | grep -vE "^- (feat|fix|chore|refactor|perf|build|ci)" || true)
195+
196+
{
197+
echo "body<<NOTES_EOF"
198+
echo "# ✨ Bangen $VERSION"
199+
echo ""
200+
echo "$SINCE_LINE"
201+
echo ""
202+
echo "---"
203+
echo ""
204+
if [[ -n "$FEATS" ]]; then
205+
echo "## πŸš€ What's New"
206+
echo "$FEATS"
207+
echo ""
208+
fi
209+
if [[ -n "$FIXES" ]]; then
210+
echo "## πŸ› Bug Fixes"
211+
echo "$FIXES"
212+
echo ""
213+
fi
214+
if [[ -n "$CHORES" ]]; then
215+
echo "## πŸ”§ Maintenance"
216+
echo "$CHORES"
217+
echo ""
218+
fi
219+
if [[ -n "$OTHER" ]]; then
220+
echo "## πŸ“ Other Changes"
221+
echo "$OTHER"
222+
echo ""
223+
fi
224+
echo "---"
225+
echo ""
226+
echo "## πŸ“¦ Downloads"
227+
echo ""
228+
echo "| Platform | File |"
229+
echo "|----------|------|"
230+
echo "| 🐧 Linux | \`bangen-linux-$VERSION.tar.gz\` |"
231+
echo "| πŸͺŸ Windows | \`bangen-windows-$VERSION.zip\` |"
232+
echo "| 🍎 macOS | \`bangen-macos-$VERSION.tar.gz\` |"
233+
echo ""
234+
echo "> πŸ”’ Verify downloads with \`SHA256SUMS.txt\`"
235+
echo "NOTES_EOF"
236+
} >> "$GITHUB_OUTPUT"
237+
163238
- uses: softprops/action-gh-release@v2
164239
with:
165240
tag_name: ${{ needs.tag.outputs.tag }}
166-
name: Bangen ${{ needs.tag.outputs.version }}
241+
name: "✨ Bangen ${{ needs.tag.outputs.version }}"
242+
body: ${{ steps.notes.outputs.body }}
167243
files: artifacts/*

0 commit comments

Comments
Β (0)