Skip to content

Commit

Permalink
fixed .dmg building in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 31, 2020
1 parent d5495a4 commit d189007
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ script:
- "make test-integration"
- "make package"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
make dist/ActivityWatch.app;
make dist/ActivityWatch.dmg;
mv dist/ActivityWatch.dmg dist/activitywatch-$(scripts/package/getversion.sh).dmg;
fi

before_deploy:
# Remove the folder from which the zip was created
# Remove things in the dist folder that shouldn't be deployed (such as the folder from which the zip was created)
- find dist/ -type f | grep -v "activitywatch-[^/]*" | xargs --no-run-if-empty rm -r

deploy:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Instructions on how to do this can be found in the guide linked above.

# These targets should always rerun
.PHONY: build install test clean clean_all dist/ActivityWatch.app
.PHONY: build install test clean clean_all

SHELL := /usr/bin/env bash

Expand Down Expand Up @@ -143,6 +143,10 @@ aw-qt/media/logo/logo.icns:
rm -R build/MyIcon.iconset
mv build/MyIcon.icns aw-qt/media/logo/logo.icns

dist/ActivityWatch.dmg: dist/ActivityWatch.app
pip install dmgbuild
dmgbuild -s scripts/package/dmgbuild-settings.py -D app=dist/ActivityWatch.app "ActivityWatch" dist/ActivityWatch.dmg

dist/ActivityWatch.app: aw-qt/media/logo/logo.icns
pip install git+git://github.com/pyinstaller/pyinstaller.git@55c8855d9db0fa596ceb28505f3ee2f402ecd4da
pyinstaller --clean --noconfirm --windowed aw.spec
Expand Down
2 changes: 0 additions & 2 deletions aw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,3 @@ if platform.system() == "Darwin":
"CFBundleIconFile": "logo.icns",
# TODO: Get the right version here
"CFBundleShortVersionString": "0.8.4"})
import subprocess
subprocess.run("dmgbuild -s dmgbuild-settings.py dist/ActivityWatch.app dist/ActivityWatch.dmg", shell=True)
File renamed without changes.
13 changes: 13 additions & 0 deletions scripts/package/getversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

if [[ $TRAVIS_TAG ]]; then
_version=$TRAVIS_TAG;
elif [[ $APPVEYOR_REPO_TAG_NAME ]]; then
_version=$APPVEYOR_REPO_TAG_NAME;
else
_version=$(git rev-parse --short HEAD)
fi

echo $_version;
10 changes: 1 addition & 9 deletions scripts/package/package-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ function get_platform() {
}

function get_version() {
if [[ $TRAVIS_TAG ]]; then
_version=$TRAVIS_TAG;
elif [[ $APPVEYOR_REPO_TAG_NAME ]]; then
_version=$APPVEYOR_REPO_TAG_NAME;
else
_version=$(git rev-parse --short HEAD)
fi

echo $_version;
$(dirname "$0")/getversion.sh;
}

function get_arch() {
Expand Down

0 comments on commit d189007

Please sign in to comment.