@@ -3,6 +3,8 @@ name: Build & Release Bangen
33on :
44 workflow_dispatch :
55 push :
6+ branches :
7+ - main
68 paths :
79 - " pyproject.toml"
810
@@ -55,71 +57,62 @@ jobs:
5557 name : Build (linux)
5658 needs : tag
5759 runs-on : ubuntu-latest
58- # Build inside manylinux2014 (CentOS 7, glibc 2.17) for maximum
59- # compatibility β covers old servers, cheap VPS, Google Colab, CI runners.
60- container :
61- image : quay.io/pypa/manylinux2014_x86_64
62- options : --user root
6360
6461 steps :
6562 - uses : actions/checkout@v4
6663
67- - name : Install Python deps
68- shell : bash
64+ - name : Build inside manylinux2014 (glibc 2.17)
6965 env :
70- PY : /opt/python/cp311-cp311/bin/python
71- run : |
72- $PY -m pip install -U pip wheel pyinstaller
73- $PY -m pip install ".[all]"
74-
75- - name : Build with PyInstaller
76- shell : bash
77- env :
78- PY : /opt/python/cp311-cp311/bin/python
7966 VERSION : ${{ needs.tag.outputs.version }}
8067 run : |
8168 printf 'from bangen.app import main\nif __name__ == "__main__":\n main()\n' > _entry.py
82- $PY -m PyInstaller \
83- --onefile \
84- --noconfirm \
85- --strip \
86- --noupx \
87- --name bangen \
88- --distpath dist \
89- --workpath build \
90- --collect-all bangen \
91- --collect-all pyfiglet \
92- --collect-all rich \
93- --collect-all PIL \
94- --collect-all typer \
95- --exclude-module tkinter \
96- --exclude-module unittest \
97- --exclude-module test \
98- --exclude-module distutils \
99- --exclude-module setuptools \
100- --exclude-module pkg_resources \
101- --exclude-module email \
102- --exclude-module http \
103- --exclude-module html \
104- --exclude-module xml \
105- --exclude-module xmlrpc \
106- --optimize 2 \
107- _entry.py
10869
109- - name : Verify glibc symbols
110- shell : bash
111- run : |
112- echo "=== GLIBC symbols in binary ==="
113- strings dist/bangen | grep "GLIBC_" | sort -V | uniq
114- echo "=== Checking for forbidden symbols above 2.17 ==="
115- if strings dist/bangen | grep -E "GLIBC_2\.(1[89]|[2-9][0-9])" | grep -v "GLIBC_2.17"; then
116- echo "ERROR: Binary requires glibc newer than 2.17!"
117- exit 1
118- fi
119- echo "β
Binary is glibc 2.17 compatible"
70+ docker run --rm \
71+ -v "${{ github.workspace }}:/workspace" \
72+ -w /workspace \
73+ -e VERSION="$VERSION" \
74+ quay.io/pypa/manylinux2014_x86_64 \
75+ bash -c '
76+ set -euo pipefail
77+ PY=/opt/python/cp311-cp311/bin/python
78+ $PY -m pip install -q -U pip wheel pyinstaller
79+ $PY -m pip install -q ".[all]"
80+ $PY -m PyInstaller \
81+ --onefile \
82+ --noconfirm \
83+ --strip \
84+ --noupx \
85+ --name bangen \
86+ --distpath dist \
87+ --workpath build \
88+ --collect-all bangen \
89+ --collect-all pyfiglet \
90+ --collect-all rich \
91+ --collect-all PIL \
92+ --collect-all typer \
93+ --exclude-module tkinter \
94+ --exclude-module unittest \
95+ --exclude-module test \
96+ --exclude-module distutils \
97+ --exclude-module setuptools \
98+ --exclude-module pkg_resources \
99+ --exclude-module email \
100+ --exclude-module http \
101+ --exclude-module html \
102+ --exclude-module xml \
103+ --exclude-module xmlrpc \
104+ --optimize 2 \
105+ _entry.py
106+ echo "=== GLIBC symbols ==="
107+ strings dist/bangen | grep "GLIBC_" | sort -V | uniq
108+ if strings dist/bangen | grep -E "GLIBC_2\.(1[89]|[2-9][0-9])"; then
109+ echo "ERROR: Binary requires glibc newer than 2.17!"
110+ exit 1
111+ fi
112+ echo "β
glibc 2.17 compatible"
113+ '
120114
121115 - name : Package artifact
122- shell : bash
123116 env :
124117 VERSION : ${{ needs.tag.outputs.version }}
125118 run : |
@@ -316,15 +309,15 @@ jobs:
316309 echo ""
317310 echo "### π§ Linux compatibility"
318311 echo ""
319- echo "The Linux binary is built inside a \`manylinux2014\` (CentOS 7) container against **glibc 2.17**, "
312+ echo "The Linux binary is built inside a \`manylinux2014\` (CentOS 7) container against **glibc 2.17**,"
320313 echo "making it compatible with virtually any Linux system from 2014 onwards β including:"
321314 echo ""
322315 echo "| Environment | Compatible |"
323316 echo "|-------------|-----------|"
324317 echo "| Google Colab | β
|"
325318 echo "| Ubuntu 16.04+ | β
|"
326319 echo "| Debian 8+ | β
|"
327- echo "| RHEL/ CentOS 7+ | β
|"
320+ echo "| RHEL / CentOS 7+ | β
|"
328321 echo "| Fedora 20+ | β
|"
329322 echo "| Old VPS / servers | β
|"
330323 echo "| GitHub Actions runners | β
|"
@@ -347,7 +340,7 @@ jobs:
347340 echo "# Move bangen.exe somewhere on your PATH"
348341 echo ""
349342 echo "# Google Colab"
350- echo "!wget -q https://github.com/\ ${{ github.repository }}/releases/download/$VERSION/bangen-linux-$VERSION.tar.gz"
343+ echo "!wget -q https://github.com/${{ github.repository }}/releases/download/$VERSION/bangen-linux-$VERSION.tar.gz"
351344 echo "!tar -xzf bangen-linux-$VERSION.tar.gz"
352345 echo "!chmod +x bangen-linux-$VERSION && mv bangen-linux-$VERSION /usr/local/bin/bangen"
353346 echo "!bangen --help"
0 commit comments