forked from Foundry376/Mailspring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
107 lines (93 loc) · 3.03 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
106
107
sudo: true
git:
submodules: false
language: node_js
node_js:
- '16'
addons:
artifacts:
working_dir: app/dist
target_paths: client/${TRAVIS_COMMIT:0:8}/${TRAVIS_OS_NAME}
permissions: public-read
paths:
- Mailspring.dmg
- Mailspring.zip
- $(find . -type f -name mailspring-*.deb | tr "\n" ":")
- $(find . -type f -name mailspring-*.rpm | tr "\n" ":")
- $(find . -type f -name mailspring-*.snap | tr "\n" ":")
snaps:
- name: snapcraft
channel: candidate
confinement: classic
- name: transfer
- name: lxd
channel: stable
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- build-essential
- libgnome-keyring-dev
- libsecret-1-dev
- execstack
- fakeroot
- rpm
- g++-5
- uuid-dev
- xvfb
branches:
only:
- master
- '/ci-.*/'
- '/stable.*/'
matrix:
include:
- os: linux
env: CC=gcc-5 CXX=g++-5
dist: bionic
- os: osx
osx_image: xcode10.1
env: CC=clang CXX=clang++ SIGN_BUILD=true
before_install:
# Decrypt and uncompress code signing certs, etc.
- if [ -n "$encrypted_faf2708e46e2_key" ] || [ "$TRAVIS_REPO_SLUG" = "Foundry376/Mailspring" ]; then
openssl aes-256-cbc -K $encrypted_faf2708e46e2_key -iv $encrypted_faf2708e46e2_iv
-in app/build/resources/certs.tar.enc -out app/build/resources/certs.tar -d; fi
- mkdir app/build/resources/certs;
- tar xvf app/build/resources/certs.tar --directory=app/build/resources/ ||
[ "$TRAVIS_REPO_SLUG" != "Foundry376/Mailspring" ]
- source app/build/resources/certs/mac/set_unix_env.sh ||
[ "$TRAVIS_REPO_SLUG" != "Foundry376/Mailspring" ]
# Resolves https://travis-ci.community/t/npm-ci-will-fail-if-cached-dependency-includes-npm/4203/6
# Don't run the copy of npm inside node_modules when erasing + building the node_modules...
install: PATH=$(echo "$PATH" | sed 's/.\/node_modules\/.bin://') npm ci
before_script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then Xvfb :99 & export DISPLAY=:99.0; fi
script:
- npm run ci-setup-mac-keychain
- npm run lint
- DEBUG=electron-packager,electron-osx-sign npm run build
cache:
directories:
- node_modules
- app/node_modules
after_success:
# Prepare the snapcraft environment
- sudo /snap/bin/lxd.migrate -yes
- sudo /snap/bin/lxd waitready
- sudo /snap/bin/lxd init --auto
- mkdir -p "$TRAVIS_BUILD_DIR/snaps-cache"
- sudo SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=y /snap/bin/snapcraft --use-lxd
- timeout 180 sudo /snap/bin/transfer *.snap
# Decrypt the snapcraft login information
- openssl aes-256-cbc -K $encrypted_d506bd5213c4_key -iv $encrypted_d506bd5213c4_iv -in .snapcraft/credentials.enc -out .snapcraft/credentials -d
- export SNAPCRAFT_STORE_CREDENTIALS=$(cat .snapcraft/credentials)
after_failure:
- test "$TRAVIS_OS_NAME" = "linux" && sudo journalctl -u snapd || true
deploy:
'on':
branch: master
condition: $TRAVIS_OS_NAME = linux
provider: script
script: sudo snapcraft push *.snap --release edge || true
skip_cleanup: true