mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-29 03:43:16 +08:00
9efa93724c
Certs aren't strictly needed to build Mailspring so let's not use them if building outside the main repository. Allows testing CI easier.
119 lines
3.2 KiB
YAML
119 lines
3.2 KiB
YAML
sudo: true
|
|
|
|
git:
|
|
submodules: false
|
|
|
|
language: node_js
|
|
|
|
node_js:
|
|
- '11'
|
|
|
|
addons:
|
|
artifacts:
|
|
working_dir: app/dist
|
|
target_paths: client/${TRAVIS_COMMIT:0:8}/${TRAVIS_OS_NAME}
|
|
permissions: public-read
|
|
paths:
|
|
- mailsync.tar.gz
|
|
- 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" ":")
|
|
apt:
|
|
sources:
|
|
- ubuntu-toolchain-r-test
|
|
packages:
|
|
- autoconf
|
|
- automake
|
|
- build-essential
|
|
- clang
|
|
- cmake
|
|
- execstack
|
|
- fakeroot
|
|
- g++-5
|
|
- git
|
|
- libc-ares-dev
|
|
- libctemplate-dev
|
|
- libcurl4-openssl-dev
|
|
- libglib2.0-dev
|
|
- libgnome-keyring-dev
|
|
- libicu-dev
|
|
- libsasl2-dev
|
|
- libsasl2-modules
|
|
- libsasl2-modules-gssapi-mit
|
|
- libsecret-1-dev
|
|
- libssl-dev
|
|
- libtidy-dev
|
|
- libtool
|
|
- libxext-dev
|
|
- libxkbfile-dev
|
|
- libxml2-dev
|
|
- libxtst-dev
|
|
- rpm
|
|
- uuid-dev
|
|
- xvfb
|
|
|
|
branches:
|
|
only:
|
|
- master
|
|
- '/ci-.*/'
|
|
- '/stable.*/'
|
|
|
|
matrix:
|
|
include:
|
|
- os: linux
|
|
env: CC=gcc-5 CXX=g++-5
|
|
dist: xenial
|
|
- 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" ]
|
|
# Checkout the C++ Mailsync codebase
|
|
- git submodule update --init mailsync
|
|
|
|
# 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
|
|
- mailsync/build.sh
|
|
- mv ./mailsync ./mailsync-src
|
|
- DEBUG=electron-packager,electron-osx-sign npm run build
|
|
|
|
cache:
|
|
directories:
|
|
- node_modules
|
|
- app/node_modules
|
|
- /tmp/mailsync-build-deps-v2
|
|
- /var/lib/docker/aufs
|
|
|
|
after_success:
|
|
# 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
|
|
|
|
services:
|
|
- docker
|
|
|
|
deploy:
|
|
'on':
|
|
branch: master
|
|
condition: $TRAVIS_OS_NAME = linux
|
|
provider: script
|
|
script: docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft && snapcraft login --with .snapcraft/credentials && (snapcraft push *.snap --release edge || true)"
|
|
skip_cleanup: true
|