Skip to content

Commit

Permalink
cleanup in packaging code, gave installer more descriptive filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 21, 2019
1 parent cde61a0 commit 03b0019
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ script:
- "make test"
- "make test-integration"
- "make package"
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
./scripts/package/package-windows-installer.sh;
fi

before_deploy:
# Remove the folder from which the zip was created
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ package:
rm -f dist/activitywatch/libdrm.so.2
# Remove unecessary files
rm -rf dist/activitywatch/pytz
#
bash scripts/package/package-zip.sh
# Builds zips and setups
bash scripts/package/package-all.sh

clean:
rm -rf build dist
Expand Down
40 changes: 28 additions & 12 deletions scripts/package/package-zip.sh → scripts/package/package-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

set -e

echo "-------------------------------------"
echo "Zipping executables..."
cd dist;

function get_platform() {
# Will return "linux" for GNU/Linux
# I'd just like to interject for a moment...
Expand Down Expand Up @@ -48,19 +44,39 @@ function get_arch() {
platform=$(get_platform)
version=$(get_version)
arch=$(get_arch)

echo "Platform: $platform, arch: $arch, version: $version"

zipname="activitywatch-${version}-${platform}-${arch}.zip"
echo "Name of package will be: $zipname"
function build_zip() {
echo "Zipping executables..."
pushd dist;
filename="activitywatch-${version}-${platform}-${arch}.zip"
echo "Name of package will be: $filename"

if [[ $platform == "windows"* ]]; then
7z a $filename activitywatch;
else
zip -r $filename activitywatch;
fi
popd;
echo "Zip built!"
}

function build_setup() {
filename="activitywatch-setup-${version}-${platform}-${arch}.exe"
echo "Name of package will be: $filename"

choco install -y innosetup

iscc scripts/package/activitywatch-setup.iss
mv dist/activitywatch-setup.exe dist/$filename
echo "Setup built!"
}


build_zip
if [[ $platform == "windows"* ]]; then
7z a $zipname activitywatch;
else
zip -r $zipname activitywatch;
build_setup
fi
cd ..;
echo "-------------------------------------"

echo
echo "-------------------------------------"
Expand Down
5 changes: 0 additions & 5 deletions scripts/package/package-windows-installer.sh

This file was deleted.

0 comments on commit 03b0019

Please sign in to comment.