Skip to content

Commit

Permalink
build: imporve macos dmg file
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Aug 30, 2024
1 parent c040d7b commit 6a59894
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="#readme" align="center">
<img alt="Until Zero - タイマー | logo" src="https://raw.githubusercontent.com/u8slvn/doggo/main/src/doggo/assets/splash.png">
<img alt="Until Zero - タイマー | logo" src="https://raw.githubusercontent.com/u8slvn/doggo/main/assets/splash.png">
</a>
</p>
<p align="center">
Expand All @@ -18,7 +18,7 @@
Here is a list of the dog states: *idle*, *idle and bark*, *walk*, *walk and bark*, *sit*, *sit and bark*, *lie down*, *lie down and bark*., *run*, *run and bark*, *stand*, *stand and bark*, *sleep*.

<p align="center">
<img alt="doggo demo" src="https://raw.githubusercontent.com/u8slvn/doggo/main/images/demo.gif">
<img alt="doggo demo" src="https://raw.githubusercontent.com/u8slvn/doggo/main/assets/demo.gif">
</p>

**Project context**: A colleague of mine wanted to have a dog, but he couldn't because of lots of reasons. So I decided to make him a virtual dog and it was the opportunity for me to play with Markov chains.
Expand Down
File renamed without changes
Binary file added assets/icon-42.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
14 changes: 8 additions & 6 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@

# ------ Build paths ------
BUILD_PATH = Path(__file__).parent.resolve()
ROOT_PATH = BUILD_PATH.parent.resolve()
PROJECT_PATH = BUILD_PATH.parent.joinpath("src").resolve()
PACKAGE_PATH = PROJECT_PATH.joinpath(PACKAGE_NAME).resolve()
ASSETS_PATH = PACKAGE_PATH.joinpath(ASSETS_FOLDER)
ASSETS_PATH = PACKAGE_PATH.joinpath(ASSETS_FOLDER).resolve()
ROOT_ASSETS_PATH = ROOT_PATH.joinpath(ASSETS_FOLDER).resolve()


def build_pyinstaller_args(
Expand All @@ -53,20 +55,20 @@ def build_pyinstaller_args(
logger.info(f"Output exe filename: {output_filename}")
build_args += ["-n", output_filename]

logger.info(f"Output file icon: {ASSETS_PATH.joinpath('icon-42.png')}")
build_args += ["--icon", f"{ASSETS_PATH.joinpath('icon-42.png')}"]
logger.info(f"Output file icon: {ROOT_ASSETS_PATH.joinpath('icon-42.png')}")
build_args += ["--icon", f"{ROOT_ASSETS_PATH.joinpath('icon-42.png')}"]

logger.info(f"Add assets folder: {ASSETS_PATH}")
build_args += ["--add-data", f"{ASSETS_PATH}:./{ASSETS_FOLDER}"]
for items in ASSETS_PATH.glob("**/*"):
if not items.is_dir():
continue
logger.info(f"Add data: {items};./{ASSETS_FOLDER}/{items.name}")
logger.info(f"Add data: {items}:./{ASSETS_FOLDER}/{items.name}")
build_args += ["--add-data", f"{items}:./{ASSETS_FOLDER}/{items.name}"]

if os in ["windows"]:
logger.info(f"Add splash image: {ASSETS_PATH.joinpath('splash.png')}")
build_args += ["--splash", f"{ASSETS_PATH.joinpath('splash.png')}"]
logger.info(f"Add splash image: {ROOT_ASSETS_PATH.joinpath('splash.png')}")
build_args += ["--splash", f"{ROOT_ASSETS_PATH.joinpath('splash.png')}"]

logger.info("Build options: onefile")
build_args += [
Expand Down
4 changes: 4 additions & 0 deletions scripts/create-appimage.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash

echo "Remove previous build if exists ..."
rm -rf ./dist/Doggo.AppImage

echo "Create AppImage ..."
appimage-builder --recipe AppImageBuilder.yml --skip-tests
10 changes: 7 additions & 3 deletions scripts/create-dmg.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash

echo "Remove previous build if exists ..."
rm -rf ./dist/Doggo.dmg

echo "Create DMG ..."
create-dmg \
--volname "Doggo" \
--window-pos 200 200 \
--window-size 460 350 \
--icon "Doggo.app" 130 60 \
--window-size 460 160 \
--icon "Doggo.app" 130 80 \
--icon-size 64 \
--hide-extension "Doggo.app" \
--app-drop-link 325 60 \
--app-drop-link 325 80 \
--format UDBZ \
--no-internet-enable \
"./dist/Doggo.dmg" \
Expand Down

0 comments on commit 6a59894

Please sign in to comment.