Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

docs: update README and add new screenshots for enhanced documentation #17

docs: update README and add new screenshots for enhanced documentation

docs: update README and add new screenshots for enhanced documentation #17

name: Build on Multi-platforms
on:
push:
pull_request:
workflow_dispatch:
inputs:
platform:
description: 'Select platform to build'
required: true
default: 'ubuntu-latest'
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
jobs:
auto-build:
if: github.event_name != 'workflow_dispatch'
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache APT packages
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Cache Nuitka MinGW (Windows)
if: matrix.os == 'windows-latest'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\Nuitka\Nuitka\Cache\DOWNLO~1
~\AppData\Local\Nuitka\Nuitka\Cache\downloads
key: ${{ runner.os }}-nuitka-mingw-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-nuitka-mingw-
- name: Cache Nuitka ccache (macOS)
if: matrix.os == 'macos-latest'
uses: actions/cache@v3
with:
path: ~/Library/Caches/Nuitka/downloads
key: ${{ runner.os }}-nuitka-ccache-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-nuitka-ccache-
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libgl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0
# 可选:安装更多 Qt 依赖
# sudo apt-get install -y libxcb-cursor0 libxcb-xfixes0 libxcb-shape0 libxcb-sync1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build
run: python build_${{ matrix.os == 'windows-latest' && 'windows' || (matrix.os == 'macos-latest' && 'macos' || 'linux') }}.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-build
path: out/
manual-build:
if: github.event_name == 'workflow_dispatch'
runs-on: ${{ github.event.inputs.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache APT packages
if: github.event.inputs.platform == 'ubuntu-latest'
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Cache Nuitka MinGW (Windows)
if: matrix.os == 'windows-latest'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\Nuitka\Nuitka\Cache\DOWNLO~1
~\AppData\Local\Nuitka\Nuitka\Cache\downloads
key: ${{ runner.os }}-nuitka-mingw-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-nuitka-mingw-
- name: Cache Nuitka ccache (macOS)
if: matrix.os == 'macos-latest'
uses: actions/cache@v3
with:
path: ~/Library/Caches/Nuitka/downloads
key: ${{ runner.os }}-nuitka-ccache-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-nuitka-ccache-
- name: Install Linux dependencies
if: github.event.inputs.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libgl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0
# 可选:安装更多 Qt 依赖
# sudo apt-get install -y libxcb-cursor0 libxcb-xfixes0 libxcb-shape0 libxcb-sync1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build
run: |
if [ "${{ github.event.inputs.platform }}" = "ubuntu-latest" ]; then
python build_linux.py
elif [ "${{ github.event.inputs.platform }}" = "macos-latest" ]; then
python build_macos.py
else
python build_windows.py
fi
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.inputs.platform }}-build
path: out/