Skip to content

Commit

Permalink
update .travis/osx_build_app.sh with git_cast_file2repos.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 6, 2019
1 parent 07e5d23 commit c16a099
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .travis/osx_build_app.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
# Builds a macOS app in a DMG container using PyInstaller and an app launcher.
# usage:
# osx_build_app.sh AppName [AppVersion]
# usage (append e.g. "App" to name to avoid naming conflicts with the library):
#
# osx_build_app.sh AppNameApp [AppVersion]
#
# Notes:
# - AppVersion is optional (only used for name of DMG container)
# - AppVersion is optional (used for name of DMG container)
# - This script must be called from the root directory of the repository
# - The file ./travis/AppNameApp.py [sic] must be present (relative
# to root of the repository)
Expand All @@ -21,21 +22,29 @@ else
NAMEVERSION=${1}_${2}
fi

# append "App" to avoid naming conflicts with python library
SCRIPT=".travis/${NAME}.py"
APP="./dist_app/${NAME}.app"
DMG="./dist_app/${NAMEVERSION}.dmg"
PKG="./dist_app/${NAME}.pkg"
TMP="./dist_app/pack.temp.dmg"
pip install pyinstaller

# cleanup from previous builds
rm -rf ./build
rm -rf ./dist_app

pip install pyinstaller

# Work in a different directory (./dist_app instead of ./dist),
# otherwise PyPI deployment on travis-CI tries to upload *.dmg files.
pyinstaller -w -y --distpath="./dist_app" --additional-hooks-dir=".travis" $SCRIPT

# Create PKG (pkgbuild is for deployments in app stores)
# https://www.manpagez.com/man/1/productbuild/
#productbuild --install-location /Applications/ --component ${APP} ${PKG}
# https://www.manpagez.com/man/1/pkgbuild/
pkgbuild --install-location /Applications/ --component ${APP} ${PKG}

# Create DMG
# add link to Applications
mkdir ./dist_app/ui-release
cd ./dist_app/ui-release
Expand All @@ -56,3 +65,4 @@ hdiutil convert "${TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG}"
# remove temporary DMG
rm $TMP


0 comments on commit c16a099

Please sign in to comment.