Update macOS build workflow for pyproject and new structure
Switches dependency installation from requirements.txt to pyproject.toml and updates pip cache key accordingly. Refactors cx_Freeze setup to use a new entry point, adjusts included files and paths to match the updated project structure, and updates icon file references.
This commit is contained in:
@@ -50,7 +50,7 @@ jobs:
|
|||||||
venv
|
venv
|
||||||
~/.cache/pip
|
~/.cache/pip
|
||||||
~/Library/Caches/pip
|
~/Library/Caches/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-
|
||||||
|
|
||||||
@@ -60,7 +60,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 dmgbuild
|
pip install --no-cache-dir cx_Freeze dmgbuild
|
||||||
|
|
||||||
- name: Prepare build variables
|
- name: Prepare build variables
|
||||||
@@ -80,6 +80,13 @@ jobs:
|
|||||||
- name: Create cx_Freeze setup script
|
- name: Create cx_Freeze setup script
|
||||||
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
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
@@ -89,14 +96,15 @@ jobs:
|
|||||||
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",
|
||||||
],
|
],
|
||||||
@@ -110,7 +118,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",
|
||||||
@@ -127,19 +134,18 @@ jobs:
|
|||||||
"tests",
|
"tests",
|
||||||
],
|
],
|
||||||
include_files=[
|
include_files=[
|
||||||
("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"),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
executables = [
|
executables = [
|
||||||
Executable(
|
Executable(
|
||||||
script="main.py",
|
script="ytsage_entry.py",
|
||||||
target_name=f"YTSage-v{version}",
|
target_name=f"YTSage-v{version}",
|
||||||
icon="assets/branding/icons/icon.icns",
|
icon="branding/icons/icon.icns",
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -150,7 +156,7 @@ jobs:
|
|||||||
options={
|
options={
|
||||||
"build_exe": build_exe_options,
|
"build_exe": build_exe_options,
|
||||||
"bdist_mac": {
|
"bdist_mac": {
|
||||||
"iconfile": "assets/branding/icons/icon.icns",
|
"iconfile": "branding/icons/icon.icns",
|
||||||
"bundle_name": f"YTSage-v{version}",
|
"bundle_name": f"YTSage-v{version}",
|
||||||
},
|
},
|
||||||
"bdist_dmg": {
|
"bdist_dmg": {
|
||||||
|
|||||||
Reference in New Issue
Block a user