From 3f0378473f7d7c1e9af24eb27c2cc732936dadfe Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Fri, 21 Jun 2019 00:05:04 +0800 Subject: [PATCH] feat(travis-ci): deploy artifacts for macOS to GitHub releases [skip appveyor] --- .travis.yml | 41 ++++++++++++++++++++++++++++------------- travis-install-linux.sh | 19 +++++++++++++++++++ travis-install-osx.sh | 3 +++ travis-install.sh | 22 ++-------------------- travis-script.sh | 7 ------- 5 files changed, 52 insertions(+), 40 deletions(-) create mode 100644 travis-install-linux.sh create mode 100644 travis-install-osx.sh delete mode 100755 travis-script.sh diff --git a/.travis.yml b/.travis.yml index 4c0afea08..6f02e7463 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/travis-install-linux.sh b/travis-install-linux.sh new file mode 100644 index 000000000..549ae4dfb --- /dev/null +++ b/travis-install-linux.sh @@ -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 diff --git a/travis-install-osx.sh b/travis-install-osx.sh new file mode 100644 index 000000000..c66b09bd7 --- /dev/null +++ b/travis-install-osx.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +make xcode/thirdparty diff --git a/travis-install.sh b/travis-install.sh index 687e75f77..68157a189 100755 --- a/travis-install.sh +++ b/travis-install.sh @@ -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 diff --git a/travis-script.sh b/travis-script.sh deleted file mode 100755 index f660799f7..000000000 --- a/travis-script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [[ "$TRAVIS_OS_NAME" == linux ]]; then - make test -elif [[ "$TRAVIS_OS_NAME" == osx ]]; then - make xcode/test -fi