diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 3b00263..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,63 +0,0 @@ -branches: - only: - - master - -environment: - MINICONDA: "C:\\Miniconda" - PYTHON: "C:\\Python36" - PYTHON_VERSION: 3.6 - PYTHON_ARCH: 32 - -platform: x86 - -configuration: Release - -init: - - set PYTHONPATH=%PYTHON% - - set PYTHONHOME=%PYTHON% - - set PATH=%PYTHON%\Scripts;%PYTHON%;C:\Program Files (x86)\NSIS;%PATH% - - python --version - - python -m pip install -U pip setuptools wheel - - pip install -U pypiwin32==223 - - pip install twisted[tls] certifi - - pip install zope.interface - - type nul > %PYTHON%\lib\site-packages\zope\__init__.py - - pip install py2exe - - pip install shiboken2==5.12.3 PySide2==5.12.3 - - pip freeze - -install: - - cd %APPVEYOR_BUILD_FOLDER% - - for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a - - python buildPy2exe.py - - type nul > syncplay_v%ver%\syncplay.ini - -# Not a project with an msbuild file, build done at install. -build: off - -artifacts: - - path: 'syncplay_v$(ver)' - type: zip - name: Syncplay_$(ver)_Portable - - - path: Syncplay-$(ver)-Setup.exe - name: Syncplay-$(ver)-Setup - -# Push artefact to S3 bucket and list all -before_deploy: - - dir - #- python -c "from PySide2 import QtCore; print QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)" - - -# Deploy build to BinTray -deploy: - provider: BinTray - username: etoh - api_key: - secure: TfwB161OlDOcAz5nnmjtNjDmJw2KyCz/uB1KzN4r5/9AL3uczWNuY+k6qVGaRvOP - repo: Syncplay - package: Syncplay - subject: syncplay - version: v$(ver) - publish: true - override: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9df8944..6dbe846 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,64 @@ name: Build on: push jobs: + windows: + name: Build for Windows + runs-on: windows-2019 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - 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: 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: 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 $null + + - name: Prepare for deployment + run: dir + + - name: Deploy portable + uses: actions/upload-artifact@v2 + with: + name: Syncplay_${{ env.VER }}_Portable + path: | + syncplay_v${{ env.VER }} + + - name: Deploy installer + uses: actions/upload-artifact@v2 + with: + name: Syncplay-${{ env.VER }}-Setup.exe + path: | + Syncplay-${{ env.VER }}-Setup.exe + macos: name: Build for macOS runs-on: macos-10.15 diff --git a/buildPy2exe.py b/buildPy2exe.py index c794702..b12af0c 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -118,7 +118,7 @@ NSIS_SCRIPT_TEMPLATE = r""" VIAddVersionKey /LANG=$${LANG_TURKISH} "FileVersion" "$version.0" VIAddVersionKey /LANG=$${LANG_TURKISH} "LegalCopyright" "Syncplay" VIAddVersionKey /LANG=$${LANG_TURKISH} "FileDescription" "Syncplay" - + LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:" @@ -757,14 +757,14 @@ info = dict( 'dist_dir': OUT_DIR, 'packages': 'PySide2, cffi, OpenSSL, certifi', 'includes': 'twisted, sys, encodings, datetime, os, time, math, urllib, ast, unicodedata, _ssl, win32pipe, win32file', - 'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32pdh, win32security, win32trace, win32ui, winxpgui, win32process, Tkinter', + 'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32pdh, win32security, win32trace, win32ui, winxpgui, win32process, tcl, tkinter', 'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll', 'optimize': 2, 'compressed': 1 } }, data_files=[("resources", resources), ("resources/lua/intf", intf_resources)], - zipfile="lib/libsync", + zipfile="lib/libsync.zip", cmdclass={"py2exe": build_installer}, )