Update Linux build workflow for PEP 517 and cx_Freeze
Switch pip install to use PEP 517 (pyproject.toml) instead of requirements.txt and update cache key accordingly. Refactor cx_Freeze setup to use new asset paths, add entry point script, and adjust include_files for correct packaging structure.
This commit is contained in:
@@ -49,7 +49,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
venv
|
venv
|
||||||
~/.cache/pip
|
~/.cache/pip
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --no-cache-dir -r requirements.txt
|
pip install --no-cache-dir .
|
||||||
pip install --no-cache-dir cx_Freeze
|
pip install --no-cache-dir cx_Freeze
|
||||||
|
|
||||||
- name: Prepare build variables
|
- name: Prepare build variables
|
||||||
@@ -82,6 +82,13 @@ jobs:
|
|||||||
- name: Create cx_Freeze setup script (Linux)
|
- name: Create cx_Freeze setup script (Linux)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
# Create entry point script
|
||||||
|
cat > ytsage_entry.py <<'ENTRY'
|
||||||
|
from ytsage.main import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
ENTRY
|
||||||
|
|
||||||
cat > setup_cxfreeze.py <<'PY'
|
cat > setup_cxfreeze.py <<'PY'
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -92,26 +99,26 @@ jobs:
|
|||||||
|
|
||||||
# Prepare include_files list
|
# Prepare include_files list
|
||||||
include_files_list = [
|
include_files_list = [
|
||||||
("src", "src"),
|
("ytsage/assets/Icon", "lib/assets/Icon"),
|
||||||
("assets/branding/icons", "lib/assets/branding/icons"),
|
("ytsage/assets/sound", "lib/assets/sound"),
|
||||||
("assets/Icon", "lib/assets/Icon"),
|
("ytsage/languages", "lib/languages"),
|
||||||
("assets/sound", "lib/assets/sound"),
|
("branding/icons", "lib/assets/branding/icons"),
|
||||||
("languages", "lib/languages"),
|
|
||||||
("ytsage.desktop", "share/applications/ytsage.desktop"),
|
("ytsage.desktop", "share/applications/ytsage.desktop"),
|
||||||
("assets/branding/icons/icon.png", "share/pixmaps/ytsage.png"),
|
("branding/icons/icon.png", "share/pixmaps/ytsage.png"),
|
||||||
]
|
]
|
||||||
|
|
||||||
build_exe_options = dict(
|
build_exe_options = dict(
|
||||||
optimize=2,
|
optimize=2,
|
||||||
packages=[
|
packages=[
|
||||||
|
"ytsage",
|
||||||
"PySide6.QtCore",
|
"PySide6.QtCore",
|
||||||
"PySide6.QtGui",
|
"PySide6.QtGui",
|
||||||
"PySide6.QtWidgets",
|
"PySide6.QtWidgets",
|
||||||
|
"PySide6.QtMultimedia",
|
||||||
"requests",
|
"requests",
|
||||||
"PIL",
|
"PIL",
|
||||||
"packaging",
|
"packaging",
|
||||||
"markdown",
|
"markdown",
|
||||||
"pyglet",
|
|
||||||
"loguru",
|
"loguru",
|
||||||
"setuptools",
|
"setuptools",
|
||||||
],
|
],
|
||||||
@@ -125,7 +132,6 @@ jobs:
|
|||||||
"PySide6.QtXml",
|
"PySide6.QtXml",
|
||||||
"PySide6.QtSql",
|
"PySide6.QtSql",
|
||||||
"PySide6.QtHelp",
|
"PySide6.QtHelp",
|
||||||
"PySide6.QtMultimedia",
|
|
||||||
"PySide6.QtQml",
|
"PySide6.QtQml",
|
||||||
"PySide6.QtQuick",
|
"PySide6.QtQuick",
|
||||||
"PySide6.QtWebEngineCore",
|
"PySide6.QtWebEngineCore",
|
||||||
@@ -144,9 +150,9 @@ jobs:
|
|||||||
include_files=include_files_list,
|
include_files=include_files_list,
|
||||||
# Bundle all dependencies - avoid system library references
|
# Bundle all dependencies - avoid system library references
|
||||||
bin_includes=[],
|
bin_includes=[],
|
||||||
bin_excludes=[],
|
bin_excludesytsage_entry.py",
|
||||||
# Important: include system libs to avoid external dependencies
|
target_name="ytsage",
|
||||||
replace_paths=[("*", "")],
|
icon="*", "")],
|
||||||
)
|
)
|
||||||
|
|
||||||
executables = [
|
executables = [
|
||||||
|
|||||||
Reference in New Issue
Block a user