Travis: build matrix MacOS + Snap

This commit is contained in:
Alberto Sottile 2019-05-01 00:11:58 +02:00
parent d04f9ada7e
commit bfc524fa2c
6 changed files with 51 additions and 25 deletions

View File

@ -1,37 +1,30 @@
language: objective-c
osx_image: xcode8.3
matrix:
include:
- language: objective-c
osx_image: xcode8.3
- language: bash
sudo: required
dist: xenial
branches:
only:
- master
script:
- python3 buildPy2app.py py2app
before_install:
- brew update
- brew upgrade python
- which python3
- python3 --version
- which pip3
- pip3 --version
- curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/dd6c67c1ba664c8910fe96aeb58f9938d97d9a53/Formula/pyside.rb -o pyside.rb
- brew install ./pyside.rb
- python3 -c "from PySide2 import __version__; print(__version__)"
- python3 -c "from PySide2.QtCore import __version__; print(__version__)"
- pip3 install py2app
- python3 -c "from py2app.recipes import pyside2"
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo snapcraft cleanbuild ; fi
install:
- pip3 install twisted[tls] appnope requests certifi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis/linux-install.sh ; fi
before_deploy:
- pip3 install dmgbuild
- mkdir dist_dmg
- mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf
- ls -al
- export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg
- python3 bintray_version.py
- mkdir dist_bintray
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-deploy.sh ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then mv syncplay_build_amd64.snap dist_bintray/syncplay_${VER}_amd64.snap ; fi
deploy:
skip_cleanup: true

View File

@ -9,7 +9,7 @@
},
"files": [
{
"includePattern": "dist_dmg/(.*)",
"includePattern": "dist_bintray/(.*)",
"uploadPattern": "$1",
"matrixParams": {
"override": 1

View File

@ -3,10 +3,12 @@
import json
from syncplay import version
f = open('bintray.json', 'r')
bintrayFileName = 'bintray.json'
f = open(bintrayFileName, 'r')
data = json.load(f)
data['version']['name'] = 'v' + version
g = open('bintray.json', 'w')
g = open(bintrayFileName, 'w')
json.dump(data, g, indent=4)

11
travis/linux-install.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
sudo groupadd --system lxd
sudo usermod -a -G lxd $USER
sudo apt-get -qq update
sudo apt-get -y install snapd
sudo snap install lxd
sudo lxd.migrate -yes
sudo lxd waitready
sudo lxd init --auto --storage-backend dir
sudo snap install snapcraft --classic

5
travis/macos-deploy.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
pip3 install dmgbuild
mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf
dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg

15
travis/macos-install.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
brew update
brew upgrade python
which python3
python3 --version
which pip3
pip3 --version
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/dd6c67c1ba664c8910fe96aeb58f9938d97d9a53/Formula/pyside.rb -o pyside.rb
brew install ./pyside.rb
python3 -c "from PySide2 import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import __version__; print(__version__)"
pip3 install py2app
python3 -c "from py2app.recipes import pyside2"
pip3 install twisted[tls] appnope requests certifi