Skip to content

Commit

Permalink
Merge pull request #243 from AcidWeb/master
Browse files Browse the repository at this point in the history
Implemented new build environments
  • Loading branch information
AcidWeb authored Aug 20, 2017
2 parents ec51d6f + d77f04a commit 3d3621c
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 62 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ test
solaio
kindlegen*
*.spec
setup.bat
setup.sh
kindlecomicconverter/sentry.py
build/
.python-version
Expand Down
56 changes: 39 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
language: generic
os: osx
osx_image: xcode6.4
matrix:
include:
- os: linux
language: python
python: 3.6
dist: trusty
sudo: required
- os: osx
language: generic
osx_image: xcode6.4

before_install:
- brew update
- brew install python3
- brew upgrade node
- pip3 install --upgrade pip setuptools wheel
- openssl aes-256-cbc -K $encrypted_a95564d8ff0d_key -iv $encrypted_a95564d8ff0d_iv -in other/osx/sentry.py.enc -out kindlecomicconverter/sentry.py -d
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then sudo apt-get -y install ruby ruby-dev ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then pip install --upgrade pip setuptools wheel ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then openssl aes-256-cbc -K $encrypted_a95564d8ff0d_key -iv $encrypted_a95564d8ff0d_iv -in other/linux/sentry.py.enc -out kindlecomicconverter/sentry.py -d ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew install python3 ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew upgrade node ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then pip3 install --upgrade pip setuptools wheel ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then openssl aes-256-cbc -K $encrypted_a95564d8ff0d_key -iv $encrypted_a95564d8ff0d_iv -in other/osx/sentry.py.enc -out kindlecomicconverter/sentry.py -d ; fi

install:
- pip3 install -r requirements.txt
- pip3 install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip
- npm install -g appdmg
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then pip install -r requirements.txt ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then pip install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then gem install fpm ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then pip3 install -r requirements.txt ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then pip3 install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then npm install -g appdmg ; fi

script: python3 setup.py build_binary

before_deploy:
- shopt -s extglob
- rm -r dist/!(*.deb|*.dmg)

deploy:
provider: releases
api_key:
secure: ZsluoJQ+diDTIjh5tvqdjAdWc1MJX6wSk5vTGFqLAMV0wK8ypGa2+qxDB0sTFR7SRhQlAfBFi0q//li+XdWn6rUkUTqjOuS9xwfdKIYXuIrIJolgsbSeenYuLeAM23VYdH6NYBHVSjIK6O1H7enRkzot4GKZk91A3MZ/SnqBjsc1KvUVmQF19xmLha1y0WYitDCy7P1cT8517Cbhg6q8yTBUn/YjfFKyuDdbQFWe894n767mr33yvm1asHtYUsPYSif6ZdvhNDtMxUMaJTX0lPG6pZQLYV2HQipppMYSdbmsQOhamjPVcF6Chy3TAK5433smk3SiNGjg2wyGiN74JYpcc0MnGE5a5ZaDzBaavSvFrGZiHeygzaZUtFx3spsqcTgdJ1LZZ1aDRTrDhzi3FMjUFDLuwyDD5nJyS9bRHE30T9me7VSAcdJGrz1joShSYK6VMFvHUG3wUk0Bd+3KJZ75lJnP6TqVLgLjkWN4rcaN9caWylzT3ximKuHDg2S2aB23YYC4HFOrYdABM9fGcnuCVDwr16bBNM8zOGxNPswKfLBX1YWBr6EOXbrypMnekZDK2T5aqTP8L0IbImGety7P8b54r7nRTqFnELYrkVxmM+fUKPMPXMm/mZadrGg3bHjZYXm+nq7V6oMI2gEcNbpzKxx6l9XOjiBjN0uk/A0=
file_glob: true
file: dist/KindleComicConverter_osx_*
provider: s3
skip_cleanup: true
access_key_id: AKIAIQNL5R4FI4C4NJYQ
secret_access_key:
secure: X66hYplxB4QSueljwvDfamNH/MQmHjo3mCofBcaTHAr7n2fp+yd2NzD2yy9h8NbsL0LWwx9wtJa/jpkIE02ZDfi9NrMLvKKFazzdpiyTMN5Yh85lHHyD1XIOCZRd4igaZ+O8975tJAEaEOPS+PE9XGZcRBh+y/eSJ+fMEgohaJ1MtDFbQR7X1cEw3iqbjrV2rlghZNCk/9mZEfObzAEjQiSDpv5G0IuIPRvYg/BgZt8chHVAe03B6oqcBa7uCBCTlfHIiNh1MWtP0B3NNBq3dcu9QHOFri1YqoZKuaPVCf6TFQL/NW5dFihegev2t9IwFyaBxytiT8fBkgQhP0VX8cuCwBAfnQGIogAu0eLSPp+E6dB/7Cpt2GDCk39+As8WKqt9hCRHmrvYhPA1Mq9QyEgKy/TKKKfDby3qVTIqYOQYpuQ1B7sIU651L5A+hBvZ1dqWIUz25h0zqjjeSFrcfNnf1e4tkk0QJvvnKqz0xsVaJxA2p07VJMRn8SlZQIJ2GEbMDeB5jxYtf5JzXywChP9adlPNjLna9G8ScnGSU1f7ZhsBQUEgY5jBlnX1lveyl3DUe6NP+qOTyljLWYwjx3AF4Zg10LYSecRS6hnqAUrGRmibDCIYclUzlJkVyjKGJ9uEyrUiCp0P0IsAzE1XhPVAWEyGUcWWGJG+jgmohSk=
bucket: kcc-deploy
region: eu-central-1
local_dir: dist
on:
repo: AcidWeb/kcc
tags: true
27 changes: 27 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
environment:
PYTHON: "C:\\Python36-x64"

install:
- set PATH="%PYTHON%\\Scripts";"C:\\Program Files (x86)\\Inno Setup 5";%PATH%
- "%PYTHON%\\python.exe -m pip install --upgrade pip setuptools wheel"
- "%PYTHON%\\python.exe -m pip install -r requirements.txt"
- "%PYTHON%\\python.exe -m pip install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip"
- nuget install secure-file -ExcludeVersion
- nuget install verpatch -ExcludeVersion
- secure-file\tools\secure-file -decrypt other\windows\Cert.pfx.enc -secret %ENCRYPTION%
- secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION%

build_script:
- "%PYTHON%\\python.exe setup.py build_binary"

after_build:
- ps: Get-ChildItem .\dist\KindleComicConverter_win_* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

deploy:
provider: S3
access_key_id:
secure: pWfyU8wtAHt354mBILwM41TemOjb+My9n3CRMnrpLzI=
secret_access_key:
secure: G0Xpxe355LMqV3s8v+TsdJYdmhFoKKA+mxK37Tlu8yNwKXKJgcnY7pcFKSdX5xS5
bucket: kcc-deploy
region: eu-central-1
18 changes: 0 additions & 18 deletions docker/Build

This file was deleted.

12 changes: 0 additions & 12 deletions docker/Dockerfile

This file was deleted.

Binary file added other/linux/sentry.py.enc
Binary file not shown.
Binary file added other/windows/Cert.pfx.enc
Binary file not shown.
3 changes: 3 additions & 0 deletions other/windows/sentry.py.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
�d�7��э��|l�z6�n�I_����:��-�!�n�BCD�}f�zIe|����\9KW�f�H[�Y�LY�7^�@m�*�Ym�_z`3�WSD{�"�a@>�;}\��,D����·�!yX��薁�~�~Y_�xd�� B�� T
B�𢯣
u�|91u~�Pa��LD�jh
4 changes: 4 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
verpatch\lib\win\verpatch dist\KCC.exe %1 /va /pv %1 /s product "Kindle Comic Converter" /s description "Kindle Comic Converter" /s copyright "Copyright (C) 2012-2017 Ciro Mattia Gonano and Pawel Jastrzebski"
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" sign /f "%APPVEYOR_BUILD_FOLDER%\other\windows\Cert.pfx" /p "%CERT_PASS%" /t http://time.certum.pl /d "Kindle Comic Converter" /du "http://kcc.iosphe.re/" dist/KCC.exe
iscc /SSignTool="""C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe"" sign /f ""%APPVEYOR_BUILD_FOLDER%\other\windows\Cert.pfx"" /p ""%CERT_PASS%"" /t http://time.certum.pl $p" kcc.iss >nul 2>&1
37 changes: 24 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,44 @@ def initialize_options(self):
def finalize_options(self):
pass

# noinspection PyShadowingNames
def run(self):
VERSION = __version__
if sys.platform == 'darwin':
if os.path.isfile('Kindle Comic Converter.spec'):
os.system('pyinstaller "Kindle Comic Converter.spec"')
else:
os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py')
os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py')
shutil.copy('other/osx/7za', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/osx/unrar', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/osx/Info.plist', 'dist/Kindle Comic Converter.app/Contents')
shutil.copy('LICENSE.txt', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/windows/Additional-LICENSE.txt', 'dist/Kindle Comic Converter.app/Contents/Resources')
os.chmod('dist/Kindle Comic Converter.app/Contents/Resources/unrar', 0o777)
os.chmod('dist/Kindle Comic Converter.app/Contents/Resources/7za', 0o777)
if os.path.isfile('setup.sh'):
os.system('./setup.sh')
os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg')
exit(0)
elif sys.platform == 'win32':
if os.path.isfile('KCC.spec'):
os.system('pyinstaller KCC.spec')
else:
os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py')
if os.path.isfile('setup.bat'):
os.system('setup.bat')
os.system('pyinstaller -y -F -i icons\comic2ebook.ico -n KCC -w --noupx kcc.py')
if os.getenv('APPVEYOR'):
if len(VERSION) == 3:
VERSION = VERSION + '.0'
os.system('setup.bat ' + VERSION)
exit(0)
else:
os.system('docker run --rm -v ' + os.getcwd() + ':/app -e KCCVER=' + VERSION + ' acidweb/kcc')
os.system('pyinstaller -F -s kcc.py')
os.system('mkdir -p dist/usr/bin dist/usr/share/applications dist/usr/share/doc/kindlecomicconverter '
'dist/usr/share/kindlecomicconverter dist/usr/share/lintian/overrides')
os.system('mv dist/kcc dist/usr/bin')
os.system('cp icons/comic2ebook.png dist/usr/share/kindlecomicconverter')
os.system('cp LICENSE.txt dist/usr/share/doc/kindlecomicconverter/copyright')
os.system('cp other/linux/kindlecomicconverter.desktop dist/usr/share/applications')
os.system('cp other/linux/kindlecomicconverter dist/usr/share/lintian/overrides')
os.chdir('dist')
os.system('fpm -f -s dir -t deb -n kindlecomicconverter -v ' + VERSION +
' -m "Paweł Jastrzębski <pawelj@iosphe.re>" --license "ISC" '
'--description "$(printf "Comic and Manga converter for e-book '
'readers.\nThis app allows you to transform your PNG, JPG, GIF, '
'CBZ, CBR and CB7 files\ninto EPUB or MOBI format e-books.")" '
'--url "https://kcc.iosphe.re/" --deb-priority "optional" --vendor "" '
'--category "graphics" -d "unrar | unrar-free" -d "p7zip-full" -d "libc6" usr')
exit(0)

setuptools.setup(
Expand Down

0 comments on commit 3d3621c

Please sign in to comment.