From 94e424f68526edb2de7a593feb9f04f238cfe364 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Thu, 22 Mar 2018 14:50:19 +0900
Subject: [PATCH] refs #78 Create makefile for production release
---
.gitignore | 1 +
Makefile | 17 +++++++++++++++++
packages/.gitkeep | 0
src/main/index.js | 3 ++-
4 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 Makefile
create mode 100644 packages/.gitkeep
diff --git a/.gitignore b/.gitignore
index 73f81959..cf92991b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,5 +8,6 @@ node_modules/
npm-debug.log
npm-debug.log.*
thumbs.db
+packages/*
!.gitkeep
*.db
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..a5328fe7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+.PHONY: release-build package
+VERSION = 0.0.0
+PLATFORM = linux
+
+ICON = ""
+ifeq (${PLATFORM}, darwin)
+ ICON = "--icon=./build/icons/whalebird.icns"
+endif
+ifeq (${PLATFORM}, windows)
+ ICON = "--icon=./build/icons/whalebird.ico"
+endif
+
+all: release-build package
+release-build: package.json
+ npm run pack
+package: release-build
+ electron-packager ./ whalebird --platform=${PLATFORM} --arch=x64 --electron-version=1.8.3 --build-version=${VERSION} --asar --out=packages --ignore="^/src" --ignore="^/test" --ignore="^/.electron-vue" --ignore="^/.envrc" --prune=true ${ICON}
diff --git a/packages/.gitkeep b/packages/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/src/main/index.js b/src/main/index.js
index 33b5d1c6..01d1d8a0 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -161,7 +161,8 @@ function createWindow () {
mainWindow = new BrowserWindow({
height: 563,
useContentSize: true,
- width: 1000
+ width: 1000,
+ icon: require('path').join(__dirname, '../../build/icons/256x256.png')
})
mainWindow.loadURL(winURL)