-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
105 lines (92 loc) · 4.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Environment Variables: https://docs.travis-ci.com/user/environment-variables/
# Note that for tags, git does not store the branch from which a commit was tagged.
# Only build on code commits, not when tags are added(eg upon publishing a draft release)
if: tag IS blank
os: linux
dist: xenial
language: node_js
node_js: "10"
env:
global:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.15.2
- export PATH="$HOME/.yarn/bin:$PATH"
install: yarn install --link-duplicates --frozen-lockfile
# Two build jobs, one on macOS, another on Linux with Docker to build Linux + Windows binaries
# Troubleshooting multi-os support: https://docs.travis-ci.com/user/multi-os/
# Default install and script for Node/JS: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
# yarn installs with frozen-lockfile to throw an error and fail build if yarn.lock needs to be updated
# and link-duplicates is an install time optimization to avoid duplicate packages?
matrix:
include:
# Travis CI uses macOS 10.13 and Xcode 9.4.1 by default.
# https://docs.travis-ci.com/user/reference/osx/#macos-version
- name: "macOS"
os: osx
script: yarn dist --macos zip
# Linux OS defaults to Ubuntu Trusty 14.04, Xenial 16.04 is the latest supported dist
# https://docs.travis-ci.com/user/reference/xenial/
- name: "Linux"
env: CACHE_BUSTER="zip"
script: yarn dist --linux zip
- name: "Linux AppImage"
env: CACHE_BUSTER="appimage"
script: yarn dist --linux AppImage
- name: "Linux Snap"
env: CACHE_BUSTER="snap"
script: yarn dist --linux snap
- name: "Linux appimage test"
env: CACHE_BUSTER="Avoid sharing the same cache key"
language: minimal
cache: false
before_install: skip
install: skip
script: echo "Hello" > test.AppImage && fallocate -l 100M bigfile.AppImage
# Windows OS has initial support on Travis:
# https://docs.travis-ci.com/user/reference/windows/
# Using WINE on Linux build for now, involves a docker pull though
- name: "Windows via WINE on Linux"
services: docker
language: minimal
# Clean out these locations before archiving cache to tar
before_cache: rm -rf $HOME/.cache/electron-builder/wine
before_install: docker pull electronuserland/builder:wine
install: skip
script:
- |
docker run --rm \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "yarn install --link-duplicates --frozen-lockfile && yarn dist --win zip nsis"
# The following is archived and uploaded to S3 after the script phase.
# The next job will download and use that cache, so large cache sizes will delay the build.
# Cache expires 28 days after the build for open source projects.
# In most cases, each matrix job will have a separate cache.
# More details: https://docs.travis-ci.com/user/caching/
cache:
yarn: true
directories:
- node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
# Workaround for bug in Travis deploy logic, `tag_name` isn't used for draft releases,
# Specify the tag to target in draft release instead for now via $TRAVIS_TAG
before_deploy: export TRAVIS_TAG="preview"
# Deploy to Github Releases as draft release or update the existing one with the above `tag_name` value(any existing files will be overwritten)
# Uses a glob pattern to lookup any file in the `dist` directory with the given extensions
# If you want the build output before packaging, they are in "unpacked" directories prefixed by the OS (eg win-unpacked), linux, and maybe osx are the other two?
deploy:
provider: releases
api_key: $OAUTH_TOKEN
skip_cleanup: true
draft: true
overwrite: true
tag_name: $TRAVIS_TAG
file_glob: true
file:
- dist/*.{exe,zip,dmg,deb,snap,AppImage,tar.gz}
- *.AppImage