Skip to content

Commit

Permalink
Migrate from Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
albertosottile committed Dec 28, 2020
1 parent 07ca6d7 commit e4c8d58
Show file tree
Hide file tree
Showing 17 changed files with 252 additions and 119 deletions.
156 changes: 156 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Build
on: push

jobs:
macos:
name: Build for macOS
runs-on: macos-10.15
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Check Python install
run: |
which python3
python3 --version
which pip3
pip3 --version
- name: Install Python dependencies
run: |
pip3 install -U setuptools wheel pip
pip3 install twisted[tls] appnope requests certifi
pip3 install shiboken2==5.13.1 pyside2==5.13.1
pip3 install py2app
- 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))"
python3 -c "import ssl; print(ssl)"
python3 -c "from py2app.recipes import pyside2"
echo $DYLD_LIBRARY_PATH
echo $DYLD_FRAMEWORK_PATH
python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))'
ls -al /Users/runner/hostedtoolcache/Python/3.7.9/x64/lib/*.dylib
- name: Build
run: |
python3 ci/pyside2_linker.py
export LIBPYTHON_FOLDER="$(python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LIBDIR"))')"
ln -s $LIBPYTHON_FOLDER/libpython3.7m.dylib $LIBPYTHON_FOLDER/libpython3.7.dylib
export DYLD_FRAMEWORK_PATH="$(python3 -c 'from PySide2.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))')"
export DYLD_LIBRARY_PATH="$(python3 -c 'import os.path, PySide2; print(os.path.dirname(PySide2.__file__))'):$(python3 -c 'import os.path, shiboken2; print(os.path.dirname(shiboken2.__file__))')"
python3 buildPy2app.py py2app
- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
ci/macos-deploy.sh
ls -al dist_actions
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: Syncplay_${{ env.VER }}.dmg
path: |
dist_actions/Syncplay_${{ env.VER }}.dmg
snapcraft:
name: Build Snap
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Snapcraft with LXD
uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true

- name: Build
run: sg lxd -c 'snapcraft --use-lxd'

- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
mv syncplay_build_amd64.snap dist_actions/syncplay_${VER}_amd64.snap
ls -al dist_actions
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: syncplay_${{ env.VER }}_amd64.snap
path: |
dist_actions/syncplay_${{ env.VER }}_amd64.snap
appimage:
name: Build AppImage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get install libxkbcommon-x11-0
- name: Build
run: ci/appimage-script.sh

- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
ci/appimage-deploy.sh
ls -al dist_actions
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: Syncplay-${{ env.VER }}-x86_64.AppImage
path: |
dist_actions/Syncplay-${{ env.VER }}-x86_64.AppImage
deb:
name: Build Debian package
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build
run: ci/deb-script.sh

- name: Test
run: ci/deb-installation-test.sh

- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
mv /tmp/syncplay.deb dist_actions/syncplay_${VER}.deb
ls -al dist_actions
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: syncplay_${{ env.VER }}.deb
path: |
dist_actions/syncplay_${{ env.VER }}.deb
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ venv
syncplay_setup.nsi
dist.7z
.*
!.travis.yml
!.appveyor.yml
!.github
__pycache__
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-->

# Syncplay
[![Travis build Status](https://travis-ci.org/Syncplay/syncplay.svg?branch=master)](https://travis-ci.org/Syncplay/syncplay)
![GitHub Actions build status](https://github.com/Syncplay/syncplay/workflows/Build/badge.svg)
[![Appveyor build status](https://ci.appveyor.com/api/projects/status/github/Syncplay/syncplay)](https://ci.appveyor.com/project/Et0h/syncplay/branch/master)

Solution to synchronize video playback across multiple instances of mpv, VLC, MPC-HC, MPC-BE and mplayer2 over the Internet.
Expand Down
20 changes: 0 additions & 20 deletions bintray.json

This file was deleted.

14 changes: 0 additions & 14 deletions bintray_version.py

This file was deleted.

2 changes: 1 addition & 1 deletion travis/appimage-deploy.sh → ci/appimage-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
chmod a+x appimagelint-x86_64.AppImage
./appimagelint-x86_64.AppImage Syncplay*.AppImage
mv Syncplay*.AppImage dist_bintray/
mv Syncplay*.AppImage dist_actions/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -x
set -e

sudo apt-get -qq update
sudo apt install /tmp/syncplay.deb -y
syncplay --no-gui
sudo apt remove syncplay
File renamed without changes.
7 changes: 6 additions & 1 deletion travis/macos-deploy.sh → ci/macos-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -ex

python3 ci/macos_app_cleaner.py
cp dist/Syncplay.app/Contents/Resources/qt.conf dist/Syncplay.app/Contents/MacOS/

mkdir dist/Syncplay.app/Contents/Resources/English.lproj
mkdir dist/Syncplay.app/Contents/Resources/en_AU.lproj
mkdir dist/Syncplay.app/Contents/Resources/en_GB.lproj
Expand All @@ -10,6 +13,8 @@ mkdir dist/Syncplay.app/Contents/Resources/Italian.lproj
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

pip3 install dmgbuild
mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf
dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg

dmgbuild -s appdmg.py "Syncplay" dist_actions/Syncplay_${VER}.dmg
File renamed without changes.
20 changes: 20 additions & 0 deletions ci/macos_app_cleaner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
import zipfile

PATH = 'dist/Syncplay.app/Contents/Resources/lib'

zin = zipfile.ZipFile(f'{PATH}/python37.zip', 'r')
tbd = [path for path in zin.namelist() if 'PySide2/Qt/' in path]

zout = zipfile.ZipFile(f'{PATH}/python37_new.zip', 'w', zipfile.ZIP_DEFLATED)

for item in zin.namelist():
buffer = zin.read(item)
if item not in tbd:
zout.writestr(item, buffer)

zout.close()
zin.close()

os.remove(f'{PATH}/python37.zip')
os.rename(f'{PATH}/python37_new.zip', f'{PATH}/python37.zip')
24 changes: 24 additions & 0 deletions ci/pyside2_linker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
from PySide2.QtCore import QLibraryInfo

def make_symlink(source, target):
if os.path.islink(target):
os.unlink(target)

os.symlink(source, target)

QT_LIB_PATH = QLibraryInfo.location(QLibraryInfo.LibrariesPath)

frameworks = [elem for elem in os.listdir(QT_LIB_PATH) if '.framework' in elem]

os.chdir(QT_LIB_PATH)

for fr in frameworks:
fr_path = os.path.join(QT_LIB_PATH, fr)
fr_name = fr.split('.framework')[0]
os.chdir(fr_path)
if 'Versions' in os.listdir('.'):
make_symlink(f'Versions/Current/{fr_name}', fr_name)
os.chdir(os.path.join(fr_path, 'Versions'))
make_symlink('5', 'Current')
os.chdir(QT_LIB_PATH)
Loading

0 comments on commit e4c8d58

Please sign in to comment.