CI: self-install Python on Windows; build Linux/arm64 in python+node container
First v0.1.0 run: Windows + Linux + arm64 failed (no Python on those runners; the docker default image also lacks Python). macOS succeeded. - windows: install Python 3.12 via the official installer in-job (idempotent). - linux-amd64 / linux-arm64: run in nikolaik/python-nodejs:python3.12-nodejs20 (has python+pip AND node for actions/checkout; multi-arch covers the Pi). - macOS job unchanged (it worked). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016yT89n4zR4qbrySoSiEyZs
This commit is contained in:
@@ -10,15 +10,21 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-latest # self-hosted Windows runner
|
runs-on: windows-latest # self-hosted Windows runner (no Python preinstalled)
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
- name: Build OBDash.exe (PyInstaller)
|
- name: Build OBDash.exe (PyInstaller)
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
|
||||||
|
Write-Host "Python not found; installing 3.12..."
|
||||||
|
$url = "https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe"
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\py.exe"
|
||||||
|
Start-Process -Wait -FilePath "$env:TEMP\py.exe" -ArgumentList "/quiet","InstallAllUsers=1","PrependPath=1","Include_test=0"
|
||||||
|
$env:Path = "C:\Program Files\Python312;C:\Program Files\Python312\Scripts;$env:Path"
|
||||||
|
}
|
||||||
|
python --version
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements-gui.txt pyinstaller
|
pip install -r requirements-gui.txt pyinstaller
|
||||||
pyinstaller --noconfirm --onefile --windowed --name OBDash --add-data "profiles;profiles" run_gui.py
|
pyinstaller --noconfirm --onefile --windowed --name OBDash --add-data "profiles;profiles" run_gui.py
|
||||||
@@ -53,17 +59,14 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
linux-amd64:
|
linux-amd64:
|
||||||
runs-on: docker # Linux x86_64 runner (container)
|
runs-on: docker # Linux x86_64 runner
|
||||||
|
container: nikolaik/python-nodejs:python3.12-nodejs20 # has python+pip AND node (for checkout)
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build OBDash (PyInstaller)
|
- name: Build OBDash (PyInstaller)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# patchelf is needed for onefile; GL/EGL/xkb are runtime deps users need
|
apt-get update && apt-get install -y patchelf libgl1 libegl1 libxkbcommon0
|
||||||
(sudo apt-get update && sudo apt-get install -y python3-venv patchelf libgl1 libegl1 libxkbcommon0) \
|
|
||||||
|| (apt-get update && apt-get install -y python3-venv patchelf libgl1 libegl1 libxkbcommon0) || true
|
|
||||||
python3 -m venv .build-venv
|
|
||||||
. .build-venv/bin/activate
|
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements-gui.txt pyinstaller
|
pip install -r requirements-gui.txt pyinstaller
|
||||||
pyinstaller --noconfirm --onefile --name OBDash --add-data "profiles:profiles" run_gui.py
|
pyinstaller --noconfirm --onefile --name OBDash --add-data "profiles:profiles" run_gui.py
|
||||||
@@ -78,15 +81,13 @@ jobs:
|
|||||||
|
|
||||||
linux-arm64:
|
linux-arm64:
|
||||||
runs-on: arm64 # Raspberry Pi (aarch64) runner
|
runs-on: arm64 # Raspberry Pi (aarch64) runner
|
||||||
|
container: nikolaik/python-nodejs:python3.12-nodejs20 # multi-arch: pulls arm64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build OBDash (PyInstaller)
|
- name: Build OBDash (PyInstaller)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
(sudo apt-get update && sudo apt-get install -y python3-venv patchelf libgl1 libegl1 libxkbcommon0) \
|
apt-get update && apt-get install -y patchelf libgl1 libegl1 libxkbcommon0
|
||||||
|| (apt-get update && apt-get install -y python3-venv patchelf libgl1 libegl1 libxkbcommon0) || true
|
|
||||||
python3 -m venv .build-venv
|
|
||||||
. .build-venv/bin/activate
|
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements-gui.txt pyinstaller
|
pip install -r requirements-gui.txt pyinstaller
|
||||||
pyinstaller --noconfirm --onefile --name OBDash --add-data "profiles:profiles" run_gui.py
|
pyinstaller --noconfirm --onefile --name OBDash --add-data "profiles:profiles" run_gui.py
|
||||||
|
|||||||
Reference in New Issue
Block a user