fix: refactor Nuitka and UPX installation steps for improved clarity and compatibility

This commit is contained in:
Vxrtrauter
2026-02-11 02:37:20 +01:00
parent 431f5fd684
commit bfb3a4eeb3
+31 -173
View File
@@ -57,7 +57,12 @@ jobs:
- name: Install Python dependencies - name: Install Python dependencies
run: | run: |
uv pip install -r requirements.txt uv pip install -r requirements.txt
uv pip install nuitka env:
UV_SYSTEM_PYTHON: 1
- name: Install Nuitka (Windows only)
if: runner.os == 'Windows'
run: uv pip install nuitka
env: env:
UV_SYSTEM_PYTHON: 1 UV_SYSTEM_PYTHON: 1
@@ -82,27 +87,16 @@ jobs:
} }
EOF EOF
- name: Install UPX - name: Install UPX (Windows)
if: runner.os == 'Windows'
shell: bash shell: bash
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then
curl -sL https://github.com/upx/upx/releases/download/v5.1.0/upx-5.1.0-win64.zip -o upx.zip curl -sL https://github.com/upx/upx/releases/download/v5.1.0/upx-5.1.0-win64.zip -o upx.zip
7z x upx.zip -oupx-dir 7z x upx.zip -oupx-dir
UPX_DIR="$(pwd)/upx-dir/upx-5.1.0-win64" UPX_DIR="$(pwd)/upx-dir/upx-5.1.0-win64"
echo "$UPX_DIR" >> $GITHUB_PATH echo "$UPX_DIR" >> $GITHUB_PATH
export PATH="$UPX_DIR:$PATH" export PATH="$UPX_DIR:$PATH"
echo "UPX_BINARY=$UPX_DIR/upx.exe" >> $GITHUB_ENV echo "UPX_BINARY=$UPX_DIR/upx.exe" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "Linux" ]; then
curl -sL https://github.com/upx/upx/releases/download/v5.1.0/upx-5.1.0-amd64_linux.tar.xz -o upx.tar.xz
tar xf upx.tar.xz
UPX_DIR="$(pwd)/upx-5.1.0-amd64_linux"
echo "$UPX_DIR" >> $GITHUB_PATH
export PATH="$UPX_DIR:$PATH"
echo "UPX_BINARY=$UPX_DIR/upx" >> $GITHUB_ENV
else
brew install upx
echo "UPX_BINARY=$(which upx)" >> $GITHUB_ENV
fi
upx --version | head -1 upx --version | head -1
- name: Convert icon for Windows - name: Convert icon for Windows
@@ -134,46 +128,6 @@ print('Icon converted successfully')
--enable-plugin=upx \ --enable-plugin=upx \
--upx-binary="${{ env.UPX_BINARY }}" \ --upx-binary="${{ env.UPX_BINARY }}" \
--noinclude-qt-translations \ --noinclude-qt-translations \
--nofollow-import-to=PySide6.QtWebEngineWidgets \
--nofollow-import-to=PySide6.QtWebEngineCore \
--nofollow-import-to=PySide6.QtWebChannel \
--nofollow-import-to=PySide6.QtMultimedia \
--nofollow-import-to=PySide6.QtMultimediaWidgets \
--nofollow-import-to=PySide6.QtQuick \
--nofollow-import-to=PySide6.QtQuickWidgets \
--nofollow-import-to=PySide6.QtQml \
--nofollow-import-to=PySide6.QtDesigner \
--nofollow-import-to=PySide6.Qt3DCore \
--nofollow-import-to=PySide6.Qt3DRender \
--nofollow-import-to=PySide6.Qt3DInput \
--nofollow-import-to=PySide6.QtBluetooth \
--nofollow-import-to=PySide6.QtNfc \
--nofollow-import-to=PySide6.QtSensors \
--nofollow-import-to=PySide6.QtSerialPort \
--nofollow-import-to=PySide6.QtTest \
--nofollow-import-to=PySide6.QtLocation \
--nofollow-import-to=PySide6.QtPdf \
--nofollow-import-to=PySide6.QtPdfWidgets \
--nofollow-import-to=PySide6.QtCharts \
--nofollow-import-to=PySide6.QtDataVisualization \
--nofollow-import-to=PySide6.QtGraphs \
--nofollow-import-to=PySide6.QtNetworkAuth \
--nofollow-import-to=PySide6.QtPositioning \
--nofollow-import-to=PySide6.QtRemoteObjects \
--nofollow-import-to=PySide6.QtScxml \
--nofollow-import-to=PySide6.QtSpatialAudio \
--nofollow-import-to=PySide6.QtSvgWidgets \
--nofollow-import-to=PySide6.QtSvg \
--nofollow-import-to=PySide6.QtTextToSpeech \
--nofollow-import-to=PySide6.QtHelp \
--nofollow-import-to=PySide6.QtOpenGL \
--nofollow-import-to=PySide6.QtOpenGLWidgets \
--nofollow-import-to=PySide6.QtDBus \
--nofollow-import-to=PySide6.QtSql \
--nofollow-import-to=PySide6.QtXml \
--nofollow-import-to=PySide6.QtConcurrent \
--nofollow-import-to=PySide6.QtHttpServer \
--nofollow-import-to=PySide6.QtStateMachine \
--include-data-dir=core/interface/assets=core/interface/assets \ --include-data-dir=core/interface/assets=core/interface/assets \
--include-data-files=build_info.json=build_info.json \ --include-data-files=build_info.json=build_info.json \
--include-data-files=build_info.json=core/build_info.json \ --include-data-files=build_info.json=core/build_info.json \
@@ -181,139 +135,43 @@ print('Icon converted successfully')
--output-filename=${{ env.APP_NAME }}.exe \ --output-filename=${{ env.APP_NAME }}.exe \
main.py main.py
- name: Build with Nuitka (Linux) - name: Build with PyInstaller (Unix)
if: runner.os == 'Linux' if: runner.os != 'Windows'
shell: bash shell: bash
run: | run: |
python -m nuitka \ pyinstaller --onefile --windowed \
--onefile \ --add-data "build_info.json:." \
--onefile-tempdir-spec="{CACHE_DIR}/${{ env.APP_NAME }}/${{ env.VERSION }}" \ --add-data "build_info.json:core" \
--assume-yes-for-downloads \ --add-data "build_info.json:core/interface" \
--enable-plugin=pyside6 \ --add-data "core/interface/assets:core/interface/assets" \
--enable-plugin=upx \ --icon "core/interface/assets/logo.png" \
--upx-binary="${{ env.UPX_BINARY }}" \ --exclude-module PyQt6 \
--noinclude-qt-translations \ --exclude-module PyQt5 \
--nofollow-import-to=PySide6.QtWebEngineWidgets \ --hidden-import=backports.tarfile \
--nofollow-import-to=PySide6.QtWebEngineCore \ --hidden-import=backports \
--nofollow-import-to=PySide6.QtWebChannel \ --hidden-import=jaraco.context \
--nofollow-import-to=PySide6.QtMultimedia \ --hidden-import=jaraco.text \
--nofollow-import-to=PySide6.QtMultimediaWidgets \ --hidden-import=jaraco.functools \
--nofollow-import-to=PySide6.QtQuick \ --name ${{ env.APP_NAME }} \
--nofollow-import-to=PySide6.QtQuickWidgets \
--nofollow-import-to=PySide6.QtQml \
--nofollow-import-to=PySide6.QtDesigner \
--nofollow-import-to=PySide6.Qt3DCore \
--nofollow-import-to=PySide6.Qt3DRender \
--nofollow-import-to=PySide6.Qt3DInput \
--nofollow-import-to=PySide6.QtBluetooth \
--nofollow-import-to=PySide6.QtNfc \
--nofollow-import-to=PySide6.QtSensors \
--nofollow-import-to=PySide6.QtSerialPort \
--nofollow-import-to=PySide6.QtTest \
--nofollow-import-to=PySide6.QtLocation \
--nofollow-import-to=PySide6.QtPdf \
--nofollow-import-to=PySide6.QtPdfWidgets \
--nofollow-import-to=PySide6.QtCharts \
--nofollow-import-to=PySide6.QtDataVisualization \
--nofollow-import-to=PySide6.QtGraphs \
--nofollow-import-to=PySide6.QtNetworkAuth \
--nofollow-import-to=PySide6.QtPositioning \
--nofollow-import-to=PySide6.QtRemoteObjects \
--nofollow-import-to=PySide6.QtScxml \
--nofollow-import-to=PySide6.QtSpatialAudio \
--nofollow-import-to=PySide6.QtSvgWidgets \
--nofollow-import-to=PySide6.QtSvg \
--nofollow-import-to=PySide6.QtTextToSpeech \
--nofollow-import-to=PySide6.QtHelp \
--nofollow-import-to=PySide6.QtOpenGL \
--nofollow-import-to=PySide6.QtOpenGLWidgets \
--nofollow-import-to=PySide6.QtDBus \
--nofollow-import-to=PySide6.QtSql \
--nofollow-import-to=PySide6.QtXml \
--nofollow-import-to=PySide6.QtConcurrent \
--nofollow-import-to=PySide6.QtHttpServer \
--nofollow-import-to=PySide6.QtStateMachine \
--include-data-dir=core/interface/assets=core/interface/assets \
--include-data-files=build_info.json=build_info.json \
--include-data-files=build_info.json=core/build_info.json \
--include-data-files=build_info.json=core/interface/build_info.json \
--output-filename=${{ env.APP_NAME }} \
main.py main.py
- name: Build with Nuitka (macOS) - name: Rename artifact
if: runner.os == 'macOS'
shell: bash shell: bash
run: | run: |
python -m nuitka \ mkdir -p dist-final
--onefile \
--onefile-tempdir-spec="{CACHE_DIR}/${{ env.APP_NAME }}/${{ env.VERSION }}" \
--assume-yes-for-downloads \
--enable-plugin=pyside6 \
--noinclude-qt-translations \
--nofollow-import-to=PySide6.QtWebEngineWidgets \
--nofollow-import-to=PySide6.QtWebEngineCore \
--nofollow-import-to=PySide6.QtWebChannel \
--nofollow-import-to=PySide6.QtMultimedia \
--nofollow-import-to=PySide6.QtMultimediaWidgets \
--nofollow-import-to=PySide6.QtQuick \
--nofollow-import-to=PySide6.QtQuickWidgets \
--nofollow-import-to=PySide6.QtQml \
--nofollow-import-to=PySide6.QtDesigner \
--nofollow-import-to=PySide6.Qt3DCore \
--nofollow-import-to=PySide6.Qt3DRender \
--nofollow-import-to=PySide6.Qt3DInput \
--nofollow-import-to=PySide6.QtBluetooth \
--nofollow-import-to=PySide6.QtNfc \
--nofollow-import-to=PySide6.QtSensors \
--nofollow-import-to=PySide6.QtSerialPort \
--nofollow-import-to=PySide6.QtTest \
--nofollow-import-to=PySide6.QtLocation \
--nofollow-import-to=PySide6.QtPdf \
--nofollow-import-to=PySide6.QtPdfWidgets \
--nofollow-import-to=PySide6.QtCharts \
--nofollow-import-to=PySide6.QtDataVisualization \
--nofollow-import-to=PySide6.QtGraphs \
--nofollow-import-to=PySide6.QtNetworkAuth \
--nofollow-import-to=PySide6.QtPositioning \
--nofollow-import-to=PySide6.QtRemoteObjects \
--nofollow-import-to=PySide6.QtScxml \
--nofollow-import-to=PySide6.QtSpatialAudio \
--nofollow-import-to=PySide6.QtSvgWidgets \
--nofollow-import-to=PySide6.QtSvg \
--nofollow-import-to=PySide6.QtTextToSpeech \
--nofollow-import-to=PySide6.QtHelp \
--nofollow-import-to=PySide6.QtOpenGL \
--nofollow-import-to=PySide6.QtOpenGLWidgets \
--nofollow-import-to=PySide6.QtDBus \
--nofollow-import-to=PySide6.QtSql \
--nofollow-import-to=PySide6.QtXml \
--nofollow-import-to=PySide6.QtConcurrent \
--nofollow-import-to=PySide6.QtHttpServer \
--nofollow-import-to=PySide6.QtStateMachine \
--include-data-dir=core/interface/assets=core/interface/assets \
--include-data-files=build_info.json=build_info.json \
--include-data-files=build_info.json=core/build_info.json \
--include-data-files=build_info.json=core/interface/build_info.json \
--output-filename=${{ env.APP_NAME }} \
main.py
- name: Prepare artifact
shell: bash
run: |
mkdir -p dist
if [ "$RUNNER_OS" == "Windows" ]; then if [ "$RUNNER_OS" == "Windows" ]; then
mv ${{ env.APP_NAME }}.exe dist/${{ matrix.artifact_name }} mv ${{ env.APP_NAME }}.exe dist-final/${{ matrix.artifact_name }}
else else
mv ${{ env.APP_NAME }} dist/${{ matrix.artifact_name }} chmod +x dist/${{ env.APP_NAME }}
chmod +x dist/${{ matrix.artifact_name }} mv dist/${{ env.APP_NAME }} dist-final/${{ matrix.artifact_name }}
fi fi
ls -la dist/ ls -la dist-final/
- name: Upload build artifact - name: Upload build artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.os }}-build name: ${{ matrix.os }}-build
path: dist/${{ matrix.artifact_name }} path: dist-final/${{ matrix.artifact_name }}
retention-days: 1 retention-days: 1
release: release: