Repository navigation
110 lines (99 loc) · 4.1 KB
/
Copy pathbuild.yml
File metadata and controls
110 lines (99 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build executables
# Workflow 1 of 2: builds the three PyInstaller executables (Text2Pen, Update,
# Installer) for Windows and every supported Linux architecture, and uploads
# them as separate build artifacts. It does not touch GitHub Releases —
# that's workflow 2, which will take these artifacts and publish them as
# individual release assets, the same way existing releases already do (so
# in-place updates via Update.exe keep working).
#
# All jobs run on GitHub-hosted runners (including the ARM64 leg, via
# GitHub's ubuntu-24.04-arm image) — no self-hosted machine is required.
#
# `workflow_call` is included so a future release workflow can trigger a
# fresh build directly instead of reusing old artifacts.
on:
workflow_dispatch:
inputs:
version:
description: "Optional label appended to artifact names (e.g. v2.8)."
required: false
default: ""
workflow_call:
inputs:
version:
description: "Optional label appended to artifact names (e.g. v2.8)."
required: false
default: ""
type: string
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows
pyinstaller: pyinstaller
add_data_sep: ";"
exe_suffix: ".exe"
# A fresh x86_64 VM every run: the common case, what almost every
# Linux desktop needs.
- os: ubuntu-22.04
label: linux-x86_64
pyinstaller: pyinstaller
add_data_sep: ":"
exe_suffix: ""
# GitHub-hosted ARM64 image. NOTE: this binary only runs on ARM64
# Linux (Raspberry Pis, ARM SBCs), never on x86_64 desktops.
- os: ubuntu-24.04-arm
label: linux-arm64
pyinstaller: pyinstaller
add_data_sep: ":"
exe_suffix: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# pywebview renders through WebKitGTK on Linux, and the portal
# screen-capture code (backend/portal_capture.py) needs GLib/D-Bus/
# GStreamer bindings. None of this is pip-installable; it has to come
# from apt, on the same interpreter pip installs into.
- name: Install Linux system dependencies
if: startsWith(matrix.label, 'linux-')
run: |
sudo apt-get update
sudo apt-get install -y \
python3-gi gir1.2-webkit2-4.1 python3-tk \
gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good gstreamer1.0-pipewire \
python3-dbus libgirepository1.0-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt pyinstaller
- name: Build Text2Pen
run: ${{ matrix.pyinstaller }} --onefile --noconsole --add-data "webui${{ matrix.add_data_sep }}webui" --name Text2Pen Text2Pen.py
- name: Build Update
run: ${{ matrix.pyinstaller }} --onefile --noconsole --name Update Update.py
- name: Build Installer
run: ${{ matrix.pyinstaller }} --onefile --noconsole --name Installer Installer.py
- name: Upload Text2Pen artifact
uses: actions/upload-artifact@v4
with:
name: Text2Pen-${{ matrix.label }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
path: dist/Text2Pen${{ matrix.exe_suffix }}
if-no-files-found: error
- name: Upload Update artifact
uses: actions/upload-artifact@v4
with:
name: Update-${{ matrix.label }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
path: dist/Update${{ matrix.exe_suffix }}
if-no-files-found: error
- name: Upload Installer artifact
uses: actions/upload-artifact@v4
with:
name: Installer-${{ matrix.label }}${{ inputs.version != '' && format('-{0}', inputs.version) || '' }}
path: dist/Installer${{ matrix.exe_suffix }}
if-no-files-found: error