From 5cabd8595f9b48d1f14b0e0d66d860b9ff28e6e0 Mon Sep 17 00:00:00 2001 From: Vjekoslav Ratkajec Date: Sat, 14 May 2016 20:54:40 +0200 Subject: [PATCH] Added deploy mechanism through npm scripts. --- app/main.js | 2 +- package.json | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/main.js b/app/main.js index 2529660..30604e7 100644 --- a/app/main.js +++ b/app/main.js @@ -21,7 +21,7 @@ if (!isDevelopment) { updateFeed = 'http://ea-todo.herokuapp.com/updates/latest'; } else if (os.platform() === 'win32') { - updateFeed = 'http://eatodo.s3.amazonaws.com/updates/releases/win' + (os.arch() === 'x64' ? '64' : '32'); + updateFeed = 'http://eatodo.s3.amazonaws.com/updates/latest/win' + (os.arch() === 'x64' ? '64' : '32'); } autoUpdater.addListener("update-available", function(event) { diff --git a/package.json b/package.json index b8962c9..2c24220 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,24 @@ "name": "eatodo", "description": "Simple TODO application built with Electron and AngularJS.", "scripts": { + "postinstall": "install-app-deps", "start": "electron ./app --enable-logging --remote-debugging-port=9222", "dev": "NODE_ENV='development' npm run start", - "dist": "npm run dist:osx && npm run dist:win32 && npm run dist:win64", - "dist:osx": "build --platform darwin", - "dist:win32": "build --platform win32 --arch ia32", - "dist:win64": "build --platform win32 --arch x64" + "pack": "npm run pack:osx && npm run pack:win", + "pack:osx": "build --platform darwin", + "pack:win": "build --platform win32 --arch all", + "dist": "npm run dist:osx && npm run dist:win", + "dist:osx": "npm run pack:osx -- -d", + "dist:win": "npm run pack:win -- -d", + "prerelease:osx": "rm -rf release/osx && mkdirp release/osx", + "release:osx": "cp -rv dist/eatodo-darwin-x64/*.{dmg,zip} release/osx && PACKAGE_VERSION=$(cat app/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && echo $PACKAGE_VERSION >> ./release/osx/VERSION", + "prerelease:win32": "rm -rf release/win32 && mkdirp release/win32", + "release:win32": "cp -v dist/win/{RELEASES,*.nupkg,*.exe} release/win32", + "prerelease:win64": "rm -rf release/win64 && mkdirp release/win64", + "release:win64": "cp -v dist/win-x64/{RELEASES,*.nupkg,*.exe} release/win64", + "release": "npm run release:osx && npm run release:win32 && npm run release:win64", + "deploy": "PACKAGE_VERSION=$(cat app/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && aws s3 sync release/ s3://eatodo/updates/$PACKAGE_VERSION/ --acl public-read && aws s3 sync s3://eatodo/updates/$PACKAGE_VERSION/ s3://eatodo/updates/latest/ --delete --acl public-read", + "all": "npm run dist && npm run release && npm run deploy" }, "author": "Vjekoslav Ratkajec", "devDependencies": {