Skip to content

Commit

Permalink
ci: overhaul ci recipes for pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 2, 2021
1 parent c27862a commit b9bc717
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ after_test:
- python setup.py sdist
- ps: "ls dist"
# Run pyinstaller
- pyinstaller -y --log-level=WARN build-recipes\\win_pyjibe.spec
- pyinstaller -y --log-level=WARN build-recipes\\win_PyJibe.spec
# Run the binary (the most simple test)
- dist\\pyjibe\\PyJibe.exe --version
# Create InnoSetup installers
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ jobs:
if: runner.os == 'macOS'
working-directory: ./build-recipes
run: |
bash ./macos_build_app.sh PyJibeApp $(git describe --tags)
cat PyJibeApp.spec
bash ./macos_build_app.sh PyJibe $(git describe --tags)
File renamed without changes.
47 changes: 47 additions & 0 deletions build-recipes/macos_PyJibe.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- mode: python ; coding: utf-8 -*-
from os.path import exists
import warnings

if not exists("./PyJibeLauncher.py")):
warnings.warn("Cannot find 'PyJibeLauncher.py'! Please run pyinstaller "+
"from the 'build-recipes' directory.")

block_cipher = None


a = Analysis(['PyJibeLauncher.py'],
pathex=['.'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=['.'],
runtime_hooks=[],
excludes=['tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='PyJibe',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='PyJibe')
app = BUNDLE(coll,
name='PyJibe.app',
icon=None,
bundle_identifier=None)
4 changes: 2 additions & 2 deletions build-recipes/macos_build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else
NAMEVERSION=${1}_${2}
fi

SCRIPT="./${NAME}.py"
SPEC="./macos_${NAME}.spec"
APP="./dist_app/${NAME}.app"
DMG="./dist_app/${NAMEVERSION}.dmg"
PKG="./dist_app/${NAME}.pkg"
Expand All @@ -36,7 +36,7 @@ rm -rf ./dist_app

pip install -r macos_build_requirements.txt

pyinstaller -w -y --distpath="./dist_app" --exclude-module tkinter --additional-hooks-dir="." $SCRIPT
pyinstaller -y --log-level=WARN --distpath="./dist_app" ${SPEC}

# Test the binary by executing it with --version argument
echo ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if not exists(join(cdir, "pyjibe")):
warnings.warn("Cannot find 'pyjibe'! Please run pyinstaller "+
"from git root folder.")

pyinstdir = os.path.realpath(cdir+"/build-recipes/")
script = os.path.join(pyinstdir, "PyJibeApp.py")
pyinstdir = os.path.realpath(cdir + "/build-recipes/")
script = os.path.join(pyinstdir, "PyJibeLauncher.py")

# Icon
icofile = os.path.join(pyinstdir,"PyJibe.ico")
icofile = os.path.join(pyinstdir, "PyJibe.ico")

a = Analysis([script],
pathex=[cdir],
Expand Down

0 comments on commit b9bc717

Please sign in to comment.