Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
RTags CI/CD setup
- Loading branch information
Showing
8 changed files
with
166 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
# | ||
# Available repositories are listed here: | ||
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json | ||
# | ||
|
||
language: cpp | ||
sudo: required | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.9 | ||
- python3-pip | ||
- libcppunit-dev | ||
|
||
git: | ||
depth: 3 | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
compiler: g++ | ||
dist: trusty | ||
env: T=g++-linux COMPILER_VERSION=-4.9 | ||
- os: osx | ||
compiler: clang | ||
env: T=clang-osx | ||
|
||
branches: | ||
only: | ||
- master | ||
- develop | ||
only: | ||
- master | ||
- develop | ||
- /^v[0-9]+\.[0-9]+$/ | ||
|
||
script: ./scripts/travis.sh | ||
jobs: | ||
include: | ||
- os: linux | ||
compiler: g++ | ||
dist: trusty | ||
env: T=g++-linux COMPILER_VERSION=-4.9 | ||
script: ./scripts/travis.sh | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.9 | ||
- python3-pip | ||
- libcppunit-dev | ||
- os: osx | ||
script: ./scripts/travis.sh | ||
compiler: clang | ||
env: T=clang-osx | ||
- stage: Release | ||
before_deploy: ./scripts/rtags-release.sh | ||
script: true | ||
deploy: | ||
provider: releases | ||
skip_cleanup: true | ||
api_key: | ||
secure: DOlyG6rhNwvBt+AfQPbOR6gjqvYQYU8rEiFB7cjOY+ghDMw8ijcd3akORusrFqhkCbDLxK2/J6VbNLZCErv/mAUOvt+FPm9DsSbrulKRAeS5l1YQoUfokAE5AFaRSHGlshilYrDvDjljpyRLyZJZheQjSTeUbZYJQEEJQpTQhOQ= | ||
file: | ||
- build/rtags-${TRAVIS_TAG#v*}.tar.bz2 | ||
- build/rtags-${TRAVIS_TAG#v*}.tar.gz | ||
on: | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,52 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
|
||
SCRIPT="$(readlink -f ${BASH_SOURCE[0]})" | ||
DIR="$(dirname $SCRIPT)" | ||
|
||
# echo "$SCRIPT $DIR" | ||
|
||
MAJOR=`echo $1 | awk -F. '{print $1}'` | ||
MINOR=`echo $1 | awk -F. '{print $2}'` | ||
MAJOR=$(echo $1 | awk -F. '{print $1}') | ||
MINOR=$(echo $1 | awk -F. '{print $2}') | ||
|
||
if ! echo "$1" | grep -q "^[0-9]\+\.[0-9]\+$"; then | ||
echo "Bad argument: \"$1\"" | ||
echo "Usage bump-version.sh 3.22" | ||
exit 1 | ||
fi | ||
|
||
SED=sed | ||
[ -n "`which gsed`" ] && SED=gsed | ||
JOBS=$(getconf _NPROCESSORS_ONLN) | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
SED=$(which gsed) | ||
else | ||
SED=$(which sed) | ||
fi | ||
|
||
if [ ! -x "$SED" ]; then | ||
echo "You need sed installed (and on Mac it needs to be gsed) to run ${BASH_SOURCE[0]}" | ||
exit 1 | ||
fi | ||
|
||
cd $DIR/.. | ||
$SED -i"" \ | ||
-e "s,^set(RTAGS_VERSION_MAJOR [0-9]\+),set(RTAGS_VERSION_MAJOR $MAJOR)," \ | ||
-e "s,^set(RTAGS_VERSION_MINOR [0-9]\+),set(RTAGS_VERSION_MINOR $MINOR)," \ | ||
CMakeLists.txt | ||
$SED -i"" \ | ||
-e "s,^(defconst rtags-package-version \"[0-9]\+\.[0-9]\+\"),(defconst rtags-package-version \"${MAJOR}.${MINOR}\")," \ | ||
-e "s,^;; Version: [0-9]\+\.[0-9]\+,;; Version: ${MAJOR}.${MINOR}," \ | ||
src/rtags.el | ||
|
||
$SED -i"" -e "s,^set(RTAGS_VERSION_MAJOR [0-9]\+),set(RTAGS_VERSION_MAJOR $MAJOR)," -e "s,^set(RTAGS_VERSION_MINOR [0-9]\+),set(RTAGS_VERSION_MINOR $MINOR)," "$DIR/../CMakeLists.txt" | ||
$SED -i"" -e "s,^(defconst rtags-package-version \"[0-9]\+\.[0-9]\+\"),(defconst rtags-package-version \"${MAJOR}.${MINOR}\")," "$DIR/../src/rtags.el" | ||
$SED -i"" -e "s,https://andersbakken\.github\.io/rtags-releases/rtags-[0-9]\+\.[0-9]\+\.tar\.,https://andersbakken.github.io/rtags-releases/rtags-$MAJOR.$MINOR.tar.,g" "$DIR/../README.org" | ||
echo "Generating manpages" | ||
if [ ! -d build ]; then | ||
mkdir build | ||
fi | ||
cd build | ||
cmake .. | ||
make man -j$JOBS | ||
cd .. | ||
|
||
git commit -m "Bump version to ${MAJOR}.${MINOR}" $DIR/../README.org $DIR/../CMakeLists.txt $DIR/../src/rtags.el | ||
git commit -m "Bump version to ${MAJOR}.${MINOR}" \ | ||
CMakeLists.txt \ | ||
src/rtags.el \ | ||
man | ||
git tag "v${MAJOR}.${MINOR}" | ||
git push --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.