diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 9a578c5..3621e82 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -50,7 +50,7 @@ jobs: venv ~/.cache/pip ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- @@ -60,7 +60,7 @@ jobs: python -m venv venv source venv/bin/activate 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 - name: Prepare build variables @@ -80,6 +80,13 @@ jobs: - name: Create cx_Freeze setup script shell: bash 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' import os from cx_Freeze import setup, Executable @@ -89,6 +96,7 @@ jobs: build_exe_options = dict( optimize=2, packages=[ + "ytsage", "PySide6.QtCore", "PySide6.QtGui", "PySide6.QtWidgets", @@ -126,19 +134,18 @@ jobs: "tests", ], include_files=[ - ("src", "src"), - ("assets/branding/icons", "lib/assets/branding/icons"), - ("assets/Icon", "lib/assets/Icon"), - ("assets/sound", "lib/assets/sound"), - ("languages", "lib/languages"), + ("ytsage/assets/Icon", "lib/assets/Icon"), + ("ytsage/assets/sound", "lib/assets/sound"), + ("ytsage/languages", "lib/languages"), + ("branding/icons", "lib/assets/branding/icons"), ], ) executables = [ Executable( - script="main.py", + script="ytsage_entry.py", target_name=f"YTSage-v{version}", - icon="assets/branding/icons/icon.icns", + icon="branding/icons/icon.icns", ) ] @@ -149,7 +156,7 @@ jobs: options={ "build_exe": build_exe_options, "bdist_mac": { - "iconfile": "assets/branding/icons/icon.icns", + "iconfile": "branding/icons/icon.icns", "bundle_name": f"YTSage-v{version}", }, "bdist_dmg": {