Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 21 additions & 86 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,31 @@ jobs:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x86

- name: Check Python install
run: |
which python
python --version
python -c "import struct; print(struct.calcsize('P') * 8)"
which pip
pip --version

- name: Install Python dependencies
run: |
pip3 install -U setuptools wheel pip
pip3 install -r requirements.txt
pip3 install -r requirements_gui.txt
pip3 install py2exe
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Check Python dependencies
run: |
python3 -c "from PySide2 import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))"
- name: Install the project
run: uv sync --all-extras --dev

- name: Build
run: |
$ver = (findstr version .\syncplay\__init__.py).split("'")[1]
echo $ver
echo "VER=$ver" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
python buildPy2exe.py
New-Item -Path syncplay_v$ver -Name "syncplay.ini" -Value " "
run: uv run pyinstaller build.spec

- name: Create installer
run: uv run ./ci/win-create-nsis.py

- name: Prepare for deployment
run: dir
run: |
$version = (Get-Content syncplay/__init__.py | Select-String -Pattern "version\s*=\s*'(.+?)'" | ForEach-Object { $_.Matches.Groups[1].Value })
echo "VER=$version" >> $env:GITHUB_ENV

- name: Deploy portable
uses: actions/upload-artifact@v4
with:
name: Syncplay_${{ env.VER }}_Portable
path: |
syncplay_v${{ env.VER }}
dist/syncplay

- name: Deploy installer
uses: actions/upload-artifact@v4
Expand All @@ -66,60 +45,16 @@ jobs:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
run: |
wget https://www.python.org/ftp/python/3.10.6/python-3.10.6-macos11.pkg
sudo installer -verbose -pkg ./python-3.10.6-macos11.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.10/bin" >> $GITHUB_PATH

- name: Check Python install
run: |
which python3
python3 --version
which pip3
pip3 --version
file $(which python3)

- name: Install Python dependencies
run: |
pip3 install -U pip setuptools==70.3.0 wheel
pip3 install -r requirements.txt
pip3 install -r requirements_gui.txt
pip3 install py2app

- name: Install universal2 dependencies
env:
CFLAGS: -arch x86_64 -arch arm64
ARCHFLAGS: -arch x86_64 -arch arm64
run: |
pip3 uninstall zope.interface -y
pip3 install --no-binary :all: zope.interface

pip3 uninstall cffi -y
pip3 install --no-binary :all: cffi
uses: actions/checkout@v4

pip3 uninstall cryptography -y
pip3 download --platform macosx_10_10_universal2 --only-binary :all: --no-deps --dest . cryptography
pip3 install --no-cache-dir --no-index --find-links . cryptography
- name: Install uv
uses: astral-sh/setup-uv@v5

pip3 uninstall charset-normalizer -y
pip3 download --platform macosx_10_9_universal2 --only-binary :all: --no-deps --dest . charset-normalizer
pip3 install --no-cache-dir --no-index --find-links . charset-normalizer

- name: Check Python dependencies
run: |
python3 -c "from PySide6 import __version__; print(__version__)"
python3 -c "from PySide6.QtCore import __version__; print(__version__)"
python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.path(QLibraryInfo.LibrariesPath))"
python3 -c "import ssl; print(ssl)"
python3 -c "from py2app.recipes import pyside6"
python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))'
- name: Install the project
run: uv sync --all-extras --dev

- name: Build
run: |
python3 buildPy2app.py py2app
run: uv run pyinstaller build.spec

- name: Prepare for deployment
run: |
Expand All @@ -139,10 +74,10 @@ jobs:

deb:
name: Build Debian package
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build
run: ci/deb-script.sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ dist.7z
!.appveyor.yml
!.github
__pycache__
requirements*.txt
1 change: 0 additions & 1 deletion appdmg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import os.path

import plistlib

application = defines.get('app', 'dist/Syncplay.app')
Expand Down
113 changes: 113 additions & 0 deletions build.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# -*- mode: python ; coding: utf-8 -*-

from syncplay import version

a = Analysis(
['syncplayClient.py'],
pathex=[],
binaries=[],
datas=[['syncplay/resources', 'resources']],
hiddenimports=[
"PySide6.QtGui",
"PySide6.QtWidgets",
"PySide6.QtCore",
"PySide2.QtGui",
"PySide2.QtWidgets",
"PySide2.QtCore",
"PyQt5.QtGui",
"PyQt5.QtWidgets",
"PyQt5.QtCore"
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=1,
)

b = Analysis(
['syncplayServer.py'],
pathex=[],
binaries=[],
datas=[['syncplay/resources', 'resources']],
optimize=1,
)
MERGE((a, "client", "client"), (b, "server", "server"))
pyz = PYZ(a.pure)
pyzb = PYZ(b.pure)

# Main executable for the client
exe_client = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='Syncplay',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['syncplay/resources/icon.ico'],
)

# Additional executable for the server
exe_server = EXE(
pyzb,
b.scripts,
[],
exclude_binaries=True,
name='syncplayServer',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True, # Use console=True for server scripts
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

coll = COLLECT(
exe_client,
exe_server,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='syncplay',
)

# Bundle the client executable and include the server executable as a resource
app = BUNDLE(
exe_client,
a.binaries,
a.datas,
[('syncplayServer', exe_server.name, 'EXECUTABLE')],
name='Syncplay.app',
icon='./syncplay/resources/icon.icns',
bundle_identifier=None,
version=version,
info_plist={
'NSPrincipalClass': 'NSApplication',
'NSAppleScriptEnabled': False,
'CFBundleDocumentTypes': [
{
'CFBundleName': 'Syncplay',
'CFBundleShortVersionString': version,
'CFBundleIdentifier': 'pl.syncplay.Syncplay',
'LSMinimumSystemVersion': '10.12.0',
'NSHumanReadableCopyright': 'Copyright © 2025 Syncplay All Rights Reserved'
}
]
}
)
43 changes: 0 additions & 43 deletions buildPy2app.py

This file was deleted.

5 changes: 1 addition & 4 deletions ci/macos-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ mkdir dist/Syncplay.app/Contents/Resources/ru.lproj
mkdir dist/Syncplay.app/Contents/Resources/Spanish.lproj
mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj

python3 ci/macos_app_adhoc_sign.py

pip3 install dmgbuild
mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf

python3 -m dmgbuild -s appdmg.py "Syncplay" dist_actions/Syncplay_${VER}.dmg
uv run dmgbuild -s appdmg.py "Syncplay" dist_actions/Syncplay_${VER}.dmg
5 changes: 0 additions & 5 deletions ci/macos_app_adhoc_sign.py

This file was deleted.

13 changes: 6 additions & 7 deletions ci/macos_app_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Clean PySide6 folder

PATH = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/PySide6'
PATH = 'dist/Syncplay.app/Contents/Resources/PySide6'

shutil.rmtree(f'{PATH}/examples', ignore_errors=True)
shutil.rmtree(f'{PATH}/include', ignore_errors=True)
Expand All @@ -41,7 +41,6 @@
for a in glob(f'{PATH}/*.app'):
to_be_deleted.append(a)

to_be_deleted.remove(f'{PATH}/Qt')
to_be_deleted.extend([f'{PATH}/lupdate', f'{PATH}/qmllint', f'{PATH}/lrelease'])

for p in to_be_deleted:
Expand All @@ -53,7 +52,7 @@

# Clean PySide6/Qt folder

PATH = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/PySide6/Qt'
PATH = 'dist/Syncplay.app/Contents/Resources/PySide6/Qt'

to_be_deleted.extend([f'{PATH}/qml', f'{PATH}/translations'])

Expand All @@ -66,7 +65,7 @@

# Clean PySide6/Qt/lib folder

PATH = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/PySide6/Qt/lib'
PATH = 'dist/Syncplay.app/Contents/Resources/PySide6/Qt/lib'

to_be_kept = ['QtCore', 'QtDBus', 'QtGui', 'QtWidgets']
to_be_deleted = [f'{PATH}/metatypes']
Expand All @@ -84,7 +83,7 @@

# Clean PySide6/Qt/plugins folder

PATH = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/PySide6/Qt/plugins'
PATH = 'dist/Syncplay.app/Contents/Resources/PySide6/Qt/plugins'

to_be_kept = ['platforms', 'styles']
to_be_deleted = []
Expand All @@ -104,8 +103,8 @@

cwd = os.getcwd()

FROM = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/shiboken6'
TO = f'dist/Syncplay.app/Contents/Resources/lib/python{pyver}/PySide6'
FROM = 'dist/Syncplay.app/Contents/Resources/shiboken6'
TO = 'dist/Syncplay.app/Contents/Resources/PySide6'

fn = os.path.basename(glob(f'{FROM}/libshiboken6*.dylib')[0])

Expand Down
Loading