Skip to content

Commit

Permalink
ci: update build recipe from https://github.com/paulmueller/travisCI-…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jul 3, 2019
1 parent 9fa6818 commit 5759187
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ after_success:
- codecov
before_deploy:
- python setup.py sdist bdist_wheel
- bash ./.travis/${TRAVIS_OS_NAME}_build_app.sh ShapeOut2
- bash ./.travis/${TRAVIS_OS_NAME}_build_app.sh ShapeOut2 $TRAVIS_TAG
deploy:
- provider: pypi
user: "ci_zmdd"
Expand All @@ -47,6 +47,7 @@ deploy:
file_glob: true
file: "dist_app/*.dmg"
skip_cleanup: true
draft: true
on:
tags: true

25 changes: 20 additions & 5 deletions .travis/osx_build_app.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
#!/bin/bash
# Builds a macOS app in a DMG container using PyInstaller and an app launcher.
# usage:
# osx_build_app.sh AppName [AppVersion]
#
# Notes:
# - AppVersion is optional (only 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)

if [ -z $1 ]; then
echo "Please specify package name as command line argument!"
exit 1
fi

NAME=$1

if [ -z $2 ]; then
NAMEVERSION=${1}
else
NAMEVERSION=${1}_${2}
fi

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

Expand All @@ -18,7 +33,7 @@ pip install pyinstaller
pyinstaller -w -y --distpath="./dist_app" --additional-hooks-dir=".travis" $SCRIPT

# create temporary DMG
hdiutil create -srcfolder "${APP}" -volname "${NAME}" -fs HFS+ \
hdiutil create -srcfolder "${APP}" -volname "${NAMEVERSION}" -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" -format UDRW "${TMP}"

# optional: edit the DMG
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ deploy:
secure: /b5SfmYssAfLaWi0qkPhxR5CruSVBZUurSQLEL3RAaRlHn6HTPrkIqvrLDk/8JxB
artifact: /.*\.exe/
draft: true
prerelease: true
on:
appveyor_repo_tag: true # deploy on tag push only

0 comments on commit 5759187

Please sign in to comment.