162 Commits

Author SHA1 Message Date
Juan Cruz Viotti
404eeffbeb chore: compile CSS into lib/gui/css (#1002)
We currently compile CSS into `build/css`, however we plan to use
node-gyp in this project, which can't be configured to build to a
directory other than `build`, therefore, the compiled CSS must move
somewhere else.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-06 15:55:07 -04:00
Juan Cruz Viotti
2dac3ac079 chore: build x64 and x86 jobs for GNU/Linux (#964)
This change makes Travis CI spawn 3 jobs:

- GNU/Linux with TARGET_ARCH=x64
- GNU/Linux with TARGET_ARCH=x86
- macOS with TARGET_ARCH=x64

We add `make info` before starting the build for convenience.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-06 11:32:53 -04:00
Juan Cruz Viotti
8e7599b366 chore: implement electron-configure-package-win32.sh (#962)
This script configures an Electron package on Windows.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-13 11:04:09 -04:00
Juan Cruz Viotti
cc96a0c1fe chore: persist temporary artifacts during AppImage builds (#936)
Currently, `electron-installer-appimage.sh` deletes temporary stuff it
needs as it goes (like the AppDir, AppImageAssistant, or even the
AppImage after creating a ZIP). Since this is not very Make-friendly,
the script has been split into the following smaller scripts that
perform a single task:

- `electron-create-appimage-linux.sh`
- `electron-create-appdir.sh`

Utilising them in different Makefile rules effectively results in Make
persisting the "temporary artifacts".

See: https://github.com/resin-io/etcher/pull/913#discussion_r90801230
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-13 10:53:10 -04:00
Andrew Scheller
07713fe6b1 chore: remove backslash-escaping in Makefile errors & warnings (#972)
They're unnecessary, and actually cause the backslash to get printed.
2016-12-12 15:34:58 -04:00
Andrew Scheller
d42291ef9d chore: add distclean target to Makefile (#971)
This new target also deletes the `node_modules` and `bower_components`
directories, taking the project directory to a totally pristine state.
2016-12-12 15:34:47 -04:00
Juan Cruz Viotti
e6d5d9c910 chore: run tests in x64 and x86 in Appveyor (#963)
This will allow us to later publish development builds for both
architectures from Appveyor. In order to easily do so, the Makefile is
used instead of the current `./scripts/build/windows.bat`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-12 14:33:16 -04:00
Andrew Scheller
c4a92d772d chore: fix error functions in Makefile (#970)
`$(error ...)` (and `$(warning ...)`) functions in a Makefile can't be indented - if they are make displays a `*** commands commence before first target. Stop.` error.
2016-12-11 18:45:26 -04:00
Juan Cruz Viotti
db379bd341 chore: use $(BUILD_OUTPUT_DIRECTORY) in PUBLISH_* accumulators (#965)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-11 18:43:00 -04:00
Juan Cruz Viotti
446e457b5b chore: move directory creation responsibility to Makefile (#946)
This commit adds new rules to create directories and sets order only
pre-requisites to the existing rules as a way to centralise directory
creation, which is currently scattered around all the build scripts.

See: https://github.com/resin-io/etcher/pull/923#discussion_r90881453
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-09 10:40:15 -04:00
Juan Cruz Viotti
b0f94b58ca chore: fix small spacing issue in Makefile (#960)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-08 15:26:46 -04:00
Andrew Scheller
d9148d585e chore: add publishing Makefile targets (#955)
If there are any files publishable to S3 then a `publish-aws-s3` target will
automagically exist, and similarly if there are any files publishable to
Bintray then a `publish-bintray-debian` target will automagically exist.
Like all phony targets, these get displayed by `make help` when available.
2016-12-08 13:47:42 -04:00
Andrew Scheller
4090fe93ad chore: speed up make startup time by using jq (#958)
By changing the `Makefile` to use `jq` instead of `node` for getting settings
from `package.json`, the time to do `make help` drops from over 1.5 seconds to
under 0.05 seconds!
2016-12-08 11:57:22 -04:00
Juan Cruz Viotti
c14257720f chore: group build scripts inside scripts/build (#940)
This makes it easier to have re-usable functionality that we can
call/source from all scripts, like logic to determine the current
operating system, or to check for a dependency in the `$PATH`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-08 11:06:35 -04:00
Andrew Scheller
316d462526 chore: add help Makefile target to show available targets (#954)
Also sets `help` as the default target, so that typing just `make` displays
the list of possible targets. Also customises the list of targets based on
TARGET_PLATFORM (because you can't build e.g. `electron-installer-dmg` when
you're on Linux).
2016-12-07 11:22:41 -04:00
Juan Cruz Viotti
b63f967d44 chore: set msvs version on dependencies-npm.sh when running on Windows (#943)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-05 23:01:04 -04:00
Juan Cruz Viotti
457ce16722 chore: make code-signing optional in OS X (#939)
Code-signing in OS X now relies on the presence of a
`CODE_SIGN_IDENTITY` variable. If it doesn't exist, all the builds will
gracefully complete without code-signing.

As a consequence of this change, the `electron-installer-dmg.sh` script
has been divided into `electron-create-readwrite-dmg.sh`,
`electron-create-readwrite-dmg.sh`, and `electron-sign-dmg.sh`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-05 22:21:28 -04:00
Juan Cruz Viotti
92bc79df15 chore: move electron package caching responsibility to GNU Make (#926)
Currently, `scripts/unix/electron-download-package.sh` contains its own
logic to determine if the package was already downloaded.

This commit takes the electron package uncompressing task to the
configure scripts, and reduce `electron-download-package.sh` to a script
that simply downloads the zip to a certain location, since this change
allows us to have a separate Make rule to download the Electron zip (and
thus have Make take care of caching).

After this change, the `electron-configure-package-*.sh` scripts are no
longer routines that modify a certain directory, but scripts that take
the zip as an input and actually create the package directory, which
aligns better with Make's design.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-05 12:28:35 -04:00
Juan Cruz Viotti
9c02f976ae style: use GNU Make foreach instead of a shell for loop (#927)
Just for conciseness and style.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-02 10:27:25 -04:00
Juan Cruz Viotti
832bfad9d1 chore: reuse npm/bower dependencies across builds (#923)
Currently, we create a "resources app" and install dependencies on it.
This means that to create another "resources app", the whole dependency
installation process needs to be repeated.

As a solution, we cache dependencies at
`release/electron-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies/` and
copy them to the resources apps as we need them.

This has the additional benefit that the resources app depends on the
dependencies rather than the other way around (dependencies depend on
the resources app), which didn't feel right.

In order to accomodate to these changes, the dependencies scripts are
now in charge of taking their corresponding manifests with them when the
prefix option is passed, given that neither `npm` nor `bower` allow to
customise the output location.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 19:52:07 -04:00
Juan Cruz Viotti
2b7f36a3c7 style: convert spaces to tabs in Makefile (#924)
Additionally, we setup an EditorConfig rule to automatically switch to
tab style on Makefile.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 19:51:53 -04:00
Juan Cruz Viotti
68a71d89e2 chore: add Makefile to build OS X and GNU/Linux (#922)
This Makefile ties together all the build scripts we've been developing
so far. It currently only supports UNIX based operating systems, but
Windows support will be added soon.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 15:16:47 -04:00
Juan Cruz Viotti
d36509d995 Implement cross-platform build scripts (#395)
With the addition of native addons to Etcher, its no longer possible to
package the application for all operating system in a single host.

Given we need to build on Windows, we're creating cross-platform bash
and batch scripts and deprecating the original Makefile.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-10 16:07:18 -04:00
Juan Cruz Viotti
e7760e253f Lock electron development version, and re-use it in Makefile (#371)
By locking the electron version in `package.json`, we can require it
from the Makefile to ensure production and development are both running
the exact same electron version, and ensures they don't easily get out
of sync.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 11:48:35 -04:00
Juan Cruz Viotti
0ac79fa251 Deprecate tar.gz GNU/Linux "installers" (#356)
We're distributing AppImages now for convenience.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 11:44:50 -04:00
Juan Cruz Viotti
dcff257f20 Upgrade Electron to v0.37.6 (#350)
* Upgrade Electron to v0.37.6

The main motiviation for such upgrade is that an error manifesting
itself as `Cannot read property 'object' of undefined` on certain Linux
systems was fixed in v0.37.4.

See https://github.com/electron/electron/issues/5229
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Make use of shell module by requiring `shell`

Otherwise we get a strange issue when trying to stub it:

    TypeError: Attempted to wrap undefined property openExternal as function

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 10:26:29 -04:00
Juan Cruz Viotti
a462ee86c0 Add Makefile rule to generate an x86 AppImage for GNU/Linux (#349)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 09:01:34 -04:00
Juan Cruz Viotti
f683b841fa Make use of AppImage desktop integration script (#346)
This is useful to prompt the user to install the `.desktop` file.

The `Description` key in `Etcher.desktop` was changed to `Comment` since
`desktop-file-validate` complained with:

    Etcher.desktop: error: file contains key "Description" in group "Desktop
    Entry", but keys extending the format should start with "X-"

After checking the desktop file format specification, the correct key
should be "Comment"
(https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s05.html).

See: bc6e519964 (commitcomment-17164442)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 16:29:16 -04:00
Juan Cruz Viotti
bc6e519964 Generate AppImage package for GNU/Linux x86_64 (#345)
Fixes: https://github.com/resin-io/etcher/issues/323
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 13:29:32 -04:00
Juan Cruz Viotti
cda27982ef Publish ZIP versions of Etcher.app (#315)
`Squirrel.Mac` works with ZIP packages rather than DMGs.

Fixes: https://github.com/resin-io/etcher/issues/314
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-13 12:29:42 -04:00
Juan Cruz Viotti
ec7ad1304f Compress Linux executables and Windows DLLs with UPX (#286)
Before:

    118M   Etcher-linux-x64
    122M   Etcher-linux-x86
    142M   Etcher-win32-x64
    116M   Etcher-win32-x86

After:

    74M    Etcher-linux-x64
    74M    Etcher-linux-x86
    124M   Etcher-win32-x64
    102M   Etcher-win32-x86

Fixes: https://github.com/resin-io/etcher/issues/281
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-11 13:31:10 -04:00
Juan Cruz Viotti
2b1ef3d980 Move package ignore list computation to a separate script (#285)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-11 12:30:00 -04:00
Juan Cruz Viotti
e1742859e1 Rename Linux binary to "etcher" (#282)
The capital letter is not very user friendly for command line people.

Fixes: https://github.com/resin-io/etcher/issues/278
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-11 10:56:07 -04:00
Juan Cruz Viotti
2e75b7f2bb Upgrade Electron to v0.36.11 (#275)
This version contains a fix for `resizable: false` not working on
GNU/Linux.

See: https://github.com/electron/electron/releases/tag/v0.36.11
Fixes: https://github.com/resin-io/etcher/issues/272
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-10 23:22:51 -04:00
Juan Cruz Viotti
77d9fadc83 Codesign OS X app inside the DMG package
This PR fixes a frequent issue users were having where opening

`Etcher.app` would result in:



    "Etcher.app" is damaged and can't be opened. You should move it to

    the trash.



Checking the code-signature of the application returned the following

error message:



    $ spctl -a -v Etcher.app

    Etcher.app: invalid signature (code or signature have been modified)



The solution is based on the following paragraphs from Apple's "OS X

Code Signing in Depth" technical note:



https://developer.apple.com/library/mac/technotes/tn2206/_index.html



> Code signing uses extended attributes to store signatures in non-Mach-O

> executables such as script files. If the extended attributes are lost

> then the program's identity will be broken. Thus, when you ship your

> script, you must use a mechanism that preserves extended attributes.

>

> One way to guarantee preservation of extended attributes is by packing

> up your signed code in a read-write disk image (DMG) file before signing

> and then, after signing, converting to read-only. You probably don't

> need to use a disk image until the final package stage so another less

> heavy-handed method would be to use ZIP or XIP files.



In summary, what we now do is:



- Create a temporal read-write DMG image.

- Perform the code-signing *inside* the DMG image.

- Convert the temporal DMG image into a compressed read-only image.



Sadly, this custom workflow doesn't fit in `electron-packager` nor

`electron-builder`, so we had to re-implement the features those

packages provide us in a nice encapsulated way ourselves.



Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-07 05:20:52 -04:00
Juan Cruz Viotti
05a5790400 Setup code-signing in Windows
Fixes: https://github.com/resin-io/etcher/issues/173
2016-03-28 13:06:13 -04:00
Juan Cruz Viotti
cb8da11b89 Add missing package metadata
- Legal copyright.
- Company name.
- File description.
- Original filename.
- Product name.
- Internal name.
2016-03-25 10:10:07 -04:00
Juan Cruz Viotti
8a9abc2c97 Wipe-out node_modules/ and force-install npm dependencies 2016-03-11 08:30:28 -04:00
Juan Cruz Viotti
c822cd07fe Add upload-all rule 2016-03-10 13:33:22 -04:00
Juan Cruz Viotti
c2dd89eadb Adhere to a more formal package naming convention
<name>-<os>-<arch>.<extension>
2016-03-10 13:32:17 -04:00
Juan Cruz Viotti
d5e58dd5b6 Add Makefile rules to publish to S3 2016-03-09 11:31:46 -04:00
Juan Cruz Viotti
95eff44af5 Move package.ignore contents to package.json
This allows `Makefile` to require and join the ignore entries easily
with NodeJS instead of relying on `tr` and `sed`.
2016-03-09 09:04:03 -04:00
Juan Cruz Viotti
9ee6df6016 Sign application in OS X using Resin's developer ID
Fixes: https://github.com/resin-io/etcher/issues/158
2016-03-02 11:04:38 -04:00
Juan Cruz Viotti
1f85fab840 Move display name setting from Makefile to package.json 2016-02-29 14:20:54 -04:00
Juan Cruz Viotti
669383712e Extend package metadata information, mainly in OS X 2016-02-29 10:36:04 -04:00
Juan Cruz Viotti
f4067bacb0 Upgrade Electron to v0.36.8
This version contains a fix to prevent dropping capabilities in renderer
threads.

See https://github.com/atom/electron/issues/3666
Fixes https://github.com/resin-io/etcher/issues/52
2016-02-19 11:01:16 -04:00
Juan Cruz Viotti
53aadb527d Rename release/ to etcher-release/
The `bluebird` module contains a directory called "release", which gets
omitted by `electron-packager`.

After some experimentation, there doesn't seems to be a way to make
`electron-packager` ignore a pattern only on the current directory,
therefore we change the name of our output directory to something that
can't possibly collide with something else.
2016-02-18 16:39:52 -04:00
Juan Cruz Viotti
eebe900be2 Implement release make rule 2016-02-09 10:42:08 -04:00
Juan Cruz Viotti
614293b0c2 Remove Makefile redundancy with functions 2016-02-09 10:34:41 -04:00
Juan Cruz Viotti
a306cf4461 Package Etcher for Linux for release 2016-02-09 10:28:49 -04:00