Files
leonpan-pc/.gitea/workflows/nuitka-build.yml
2025-10-29 22:20:21 +08:00

55 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Nuitka 编译 Linux 可执行文件
on:
workflow_dispatch:
inputs:
build_reason:
description: "触发构建的原因(选填)"
required: false
default: "手动触发 Linux 可执行文件构建"
jobs:
compile-linux-exe:
runs-on: ubuntu-latest
steps:
# 步骤1Gitea 原生拉取代码(解决 GitHub 超时)
- name: Gitea 原生拉取仓库代码
uses: actions/checkout@v4
# 步骤2配置 Linux 编译环境与依赖(移除 mingw-w64 交叉工具)
- name: 配置编译环境与依赖
run: |
sudo apt update && sudo apt install -y python3-venv python3-dev patchelf
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \
fake_useragent==2.2.0 \
loguru==0.7.3 \
numpy==2.3.3 \
Pillow==11.3.0 \
pycryptodome==3.21.0 \
PyQt6==6.9.2 \
PyQt6-fluent-widgets==1.8.4 \
PySideSix_Frameless_Window==0.4.3 \
Requests==2.32.5 \
rsa==4.9.1 \
nuitka
# 步骤3Nuitka 编译 Linux 可执行文件(删除 --mingw64 交叉参数)
- name: Nuitka 编译 Linux 可执行文件
run: |
source .venv/bin/activate
nuitka --standalone \
--assume-yes-for-downloads \
--nofollow-import-to=numpy,scipy,PIL,colorthief \
--enable-plugins=PyQt6 \
--show-progress \
--output-dir=build \
./main.py
# 步骤4上传 Linux 产物(路径不变,产物为无后缀名的可执行文件)
- name: 上传 Linux 可执行产物
uses: actions/upload-artifact@v3
with:
name: Linux-Executable-Output
path: ./build/* # Linux 产物无后缀,默认与源码主文件同名
retention-days: 7