Skip to content

Commit 18efd74

Browse files
committed
Run Linux build and release jobs on the self-hosted runner
- build.yml: the Linux matrix leg now targets [self-hosted, Linux] instead of ubuntu-22.04. Skips setup-python and apt-get there (the runner is a persistent Pi, not an ephemeral VM) and builds inside a fresh --system-site-packages venv per run instead. - release.yml: the release job also runs on [self-hosted, Linux]. - Note: this makes the Linux binaries ARM, not x86_64.
1 parent fdca20a commit 18efd74

2 files changed

Lines changed: 51 additions & 22 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,52 +32,78 @@ jobs:
3232
include:
3333
- os: windows-latest
3434
label: windows
35-
# 22.04 rather than the rolling ubuntu-latest: PyInstaller freezes
36-
# against the build machine's glibc, and an older baseline keeps
37-
# the binary runnable on users' (likely older) systems too.
38-
- os: ubuntu-22.04
35+
# Self-hosted (a Raspberry Pi) rather than a GitHub-hosted runner.
36+
# NOTE: this makes the Linux build an ARM binary, not x86_64 — it
37+
# will only run on ARM Linux (e.g. other Pis), not typical x86_64
38+
# desktops. If both are needed, add back a GitHub-hosted
39+
# `ubuntu-22.04` leg alongside this one.
40+
- os: [self-hosted, Linux]
3941
label: linux
4042
runs-on: ${{ matrix.os }}
4143
steps:
4244
- uses: actions/checkout@v4
4345

46+
# actions/setup-python doesn't reliably have a matching download for
47+
# every Python version on ARM, and isn't needed anyway: the self-hosted
48+
# runner is a persistent machine with its own system Python already
49+
# set up (see the apt note below), unlike an ephemeral GitHub-hosted VM.
4450
- uses: actions/setup-python@v5
51+
if: matrix.label == 'windows'
4552
with:
4653
python-version: "3.12"
4754

48-
# pywebview renders through WebKitGTK on Linux, and the new portal
49-
# screen-capture code (backend/portal_capture.py) needs GLib/D-Bus/
50-
# GStreamer bindings. None of this is pip-installable; it has to come
51-
# from apt, on the same interpreter pip installs into (no venv here).
52-
- name: Install Linux system dependencies
53-
if: matrix.label == 'linux'
54-
run: |
55-
sudo apt-get update
56-
sudo apt-get install -y \
57-
python3-gi gir1.2-webkit2-4.1 python3-tk \
58-
gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-base \
59-
gstreamer1.0-plugins-good gstreamer1.0-pipewire \
60-
python3-dbus libgirepository1.0-dev
55+
# Deliberately no apt-get step for Linux here: the self-hosted runner
56+
# is a persistent machine, so system packages only need installing
57+
# once, by hand, not on every run:
58+
# sudo apt-get install -y python3-gi gir1.2-webkit2-4.1 python3-tk \
59+
# gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-base \
60+
# gstreamer1.0-plugins-good gstreamer1.0-pipewire \
61+
# python3-dbus libgirepository1.0-dev python3-venv \
62+
# build-essential python3-dev
63+
# (the last three are for pip to build python-uinput/pynput from
64+
# source on ARM, where prebuilt wheels are less common.)
6165

62-
- name: Install Python dependencies
66+
- name: Install Python dependencies (Windows)
67+
if: matrix.label == 'windows'
6368
run: |
6469
python -m pip install --upgrade pip
6570
pip install -r requirements.txt pyinstaller
6671
72+
# --system-site-packages: pywebview's WebKitGTK bindings and the
73+
# portal-capture GLib/GStreamer bindings only exist as apt packages
74+
# (see above), not on PyPI, so the venv needs to see the system ones.
75+
- name: Install Python dependencies (Linux)
76+
if: matrix.label == 'linux'
77+
run: |
78+
rm -rf venv
79+
python3 -m venv --system-site-packages venv
80+
venv/bin/pip install --upgrade pip
81+
venv/bin/pip install -r requirements.txt pyinstaller
82+
6783
- name: Build Text2Pen (Windows)
6884
if: matrix.label == 'windows'
6985
run: pyinstaller --onefile --noconsole --add-data "webui;webui" --name Text2Pen Text2Pen.py
7086

7187
- name: Build Text2Pen (Linux)
7288
if: matrix.label == 'linux'
73-
run: pyinstaller --onefile --noconsole --add-data "webui:webui" --name Text2Pen Text2Pen.py
89+
run: venv/bin/pyinstaller --onefile --noconsole --add-data "webui:webui" --name Text2Pen Text2Pen.py
7490

75-
- name: Build Update
91+
- name: Build Update (Windows)
92+
if: matrix.label == 'windows'
7693
run: pyinstaller --onefile --noconsole --name Update Update.py
7794

78-
- name: Build Installer
95+
- name: Build Update (Linux)
96+
if: matrix.label == 'linux'
97+
run: venv/bin/pyinstaller --onefile --noconsole --name Update Update.py
98+
99+
- name: Build Installer (Windows)
100+
if: matrix.label == 'windows'
79101
run: pyinstaller --onefile --noconsole --name Installer Installer.py
80102

103+
- name: Build Installer (Linux)
104+
if: matrix.label == 'linux'
105+
run: venv/bin/pyinstaller --onefile --noconsole --name Installer Installer.py
106+
81107
- name: Upload Text2Pen artifact
82108
uses: actions/upload-artifact@v4
83109
with:

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ jobs:
3535

3636
release:
3737
needs: build
38-
runs-on: ubuntu-latest
38+
# Self-hosted, same as build.yml's Linux leg. Needs `git` on PATH for the
39+
# tag check below (actions/checkout itself can fall back to the REST API
40+
# without it, but this job's own script can't).
41+
runs-on: [self-hosted, Linux]
3942
steps:
4043
- uses: actions/checkout@v4
4144
with:

0 commit comments

Comments
 (0)