Skip to content

Commit

Permalink
feat(travis-ci): deploy artifacts for macOS to GitHub releases [skip …
Browse files Browse the repository at this point in the history
…appveyor]
  • Loading branch information
lotem committed Jun 21, 2019
1 parent 6948a62 commit 3f03784
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 40 deletions.
41 changes: 28 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
language: cpp

matrix:
include:
- os: osx
compiler: clang
- os: linux
compiler: gcc
dist: trusty
sudo: required

install:
./travis-install.sh

script:
./travis-script.sh
- os: linux
compiler: gcc
dist: trusty
sudo: required
install: "./travis-install.sh"
script: make test
- os: osx
compiler: clang
install: "./travis-install.sh"
script: make xcode/test
before_deploy:
- make xcode/dist
- |
zip -r rime-${TRAVIS_TAG}-${TRAVIS_OS_NAME}.zip \
dist thirdparty/bin thirdparty/share \
-x '*/curl.exe'
deploy:
provider: releases
api_key:
secure: OXzu4Au7Uri/4pugRsQATYv2+QHNRfx64jRBSTdYUJ8ehdg67HHJrofxhUG2Q+lNZlm2VO51ihOsmp9c3gYtT+ohSxD3/y3z8VDw6k7a+5ihT+Svrr1fpHf30I2DupGe5bO1MFB9rltZ+kv/nERciT5n1jOO5ZxefNCRac2aylE=
file: rime-${TRAVIS_TAG}-${TRAVIS_OS_NAME}.zip
skip_cleanup: true
name: "librime ${TRAVIS_TAG}"
body: "chore(release): ${TRAVIS_TAG} :tada:"
draft: true
on:
repo: rime/librime
tags: true
19 changes: 19 additions & 0 deletions travis-install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

dep_packages=(
doxygen
libboost-filesystem-dev
libboost-locale-dev
libboost-regex-dev
libboost-system-dev
libgoogle-glog-dev
libleveldb-dev
libmarisa-dev
libyaml-cpp-dev
)

sudo apt-get update
sudo apt-get install ${dep_packages[@]} -y
make thirdparty/gtest
make -C thirdparty/src/opencc build
sudo env "PATH=$PATH" make -C thirdparty/src/opencc install
3 changes: 3 additions & 0 deletions travis-install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

make xcode/thirdparty
22 changes: 2 additions & 20 deletions travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,8 @@

cd "$(dirname "$0")"

dep_packages=(
doxygen
libboost-filesystem-dev
libboost-locale-dev
libboost-regex-dev
libboost-system-dev
libgoogle-glog-dev
libleveldb-dev
libmarisa-dev
libyaml-cpp-dev
)

if [[ "$TRAVIS_OS_NAME" == linux ]]; then
sudo apt-get update
sudo apt-get install ${dep_packages[@]} -y
make thirdparty/gtest
make -C thirdparty/src/opencc build
sudo env "PATH=$PATH" make -C thirdparty/src/opencc install
elif [[ "$TRAVIS_OS_NAME" == osx ]]; then
make xcode/thirdparty
if [[ -n "$TRAVIS_OS_NAME" ]]; then
bash "./travis-install-${TRAVIS_OS_NAME}.sh"
fi

if [[ -n "${RIME_PLUGINS}" ]]; then
Expand Down
7 changes: 0 additions & 7 deletions travis-script.sh

This file was deleted.

0 comments on commit 3f03784

Please sign in to comment.