diff --git a/Makefile b/Makefile index 7893e4b3..d29e2117 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ ELECTRON_VERSION=0.36.8 ETCHER_VERSION=$(shell node -e "console.log(require('./package.json').version)") APPLICATION_NAME=$(shell node -e "console.log(require('./package.json').displayName)") SIGN_IDENTITY_OSX="Rulemotion Ltd (66H43P8FRG)" +S3_BUCKET="resin-production-downloads" etcher-release/Etcher-darwin-x64: . $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \ @@ -111,11 +112,20 @@ installer-linux: etcher-release/installers/Etcher-linux-x64.tar.gz etcher-releas installer-win32: etcher-release/installers/Etcher-x64.exe etcher-release/installers/Etcher.exe installer-all: installer-osx installer-linux installer-win32 -etcher-release: - rm -rf node_modules - npm install --force - npm test - make installer-all +S3_UPLOAD=aws s3api put-object \ + --bucket $(S3_BUCKET) \ + --acl public-read \ + --key etcher/$(ETCHER_VERSION)/$(notdir $<) \ + --body $< + +upload-linux-x64: etcher-release/installers/Etcher-linux-x64.tar.gz ; $(S3_UPLOAD) +upload-linux-ia32: etcher-release/installers/Etcher-linux-ia32.tar.gz ; $(S3_UPLOAD) +upload-win32-x64: etcher-release/installers/Etcher-x64.exe ; $(S3_UPLOAD) +upload-win32-ia32: etcher-release/installers/Etcher.exe ; $(S3_UPLOAD) + +upload-osx: etcher-release/installers/Etcher.dmg ; $(S3_UPLOAD) +upload-linux: upload-linux-x64 upload-linux-ia32 +upload-win32: upload-win32-x64 upload-win32-ia32 clean: rm -rf etcher-release/ diff --git a/PUBLISHING.md b/PUBLISHING.md index f1bf17a6..b1490729 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -6,10 +6,24 @@ This is a small guide to package and publish Etcher to all supported operating s Prequisites ----------- -- [wine](https://www.winehq.org) -- [nsis](http://nsis.sourceforge.net/Main_Page) -- [node](https://nodejs.org) +- [NodeJS](https://nodejs.org) - [GNU Make](https://www.gnu.org/software/make/) +- [wine (for Windows)](https://www.winehq.org) +- [nsis (for Windows)](http://nsis.sourceforge.net/Main_Page) +- [XCode (for OS X)](https://developer.apple.com/xcode://developer.apple.com/xcode/) +- [AWS CLI (for uploading packages)](https://aws.amazon.com/cli://aws.amazon.com/cli/) + +If you're going to generate installers for another platform than the one you're currently running, make sure you force-install all NPM dependencies, so optional dependencies marked for a certain operating system get installed regardless of the host operating system + +```sh +npm install --force +``` + +You can run the following command at any time to start from a fresh state: + +```sh +make clean +``` Signing ------- @@ -28,9 +42,34 @@ Packaging Run the following command to make installers for all supported operating systems: ```sh -make release +make installer-all +``` + +You can replace `all` with `osx`, `linux` or `win32` to only generate installers for those platforms: + +```sh +make installer-osx +make installer-linux +make installer-win32 ``` The resulting installers will be saved to `etcher-release/installers`. -You can run `make clean` to start in a fresh state. +Uploading +--------- + +Make sure you have the [AWS CLI tool](https://aws.amazon.com/cli://aws.amazon.com/cli/) installed and configured to access Resin.io's production downloads S3 bucket. + +Run the following command to upload all installers: + +```sh +make upload-all +``` + +As with the `installer` rule, you can replace `all` with `osx`, `linux` or `win32` to only publish those platform's installers: + +```sh +make upload-osx +make upload-linux +make upload-win32 +```