Skip to content

Commit

Permalink
Add release deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jupp0r committed Aug 25, 2016
1 parent 25b0ab5 commit 0fc2255
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 27 deletions.
69 changes: 62 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
language: rust
sudo: required
dist: trusty
env:
global:
- secure: "YCOq0vX7+PsvQvoaanVTGrVepfnFJSUDvVRDoYGaXfeJQJaF1PBUbge9MF9WrRZT8J9wQ3QyoAuPaGEBH0Dr5MD8PVIP7n1BMh88Y49giF87A+H88pj953HqmJ94BfI16gjMsCYGOdSDBu2LFWIw6VzI8gxnQsa7QJ9JKzzSDX/HuyixAVr1HOSbTFHQmIkPLLQYJt7xJxouKGt3hztsx29RKH6P6/eiRB1prVA3uYlBCpsrpt3pBd+cJubDcA0nu0ZW7L3L3kIVp2QqgCfuuR3ktQQ7oYnhvAvGeQ5CnJZl4XoPc0s0lcqoGYefZhrA+Na23YjYHBTgdmh3qgXelF9+9SOKrYT6HTlnCk+SIQrPQSrOIUgJnE6BpyFWqlIDGyJjQnC7OVodAAyr82o+Bcoth17106jMordjVA6l8yZT6Cjx2ddfyb/b0vH6m6UumMwdgM9RLlJ5x+S6QppW+Qtm1U7FDZt0TO/MPxSYUWDmpO9GaFcKjCSyulpWS+mA1qyk0Q6a9fb1uqvjgZMvSgopw7Min+/0jpBh3DkwAjz8Amm1ZAuvEV7/8+a/QhluvSzjHAYzY4/E+qillNn/qJp2qST3pikCxbYiO7tP1mNEhR0u6T5XqjgtKQ5ALl3g/CQr7WZWF/NdRyLSkJvI2ULJmHsIIlcdwoF0FcHpEyc="
- secure: "dE+mh5SJ/Qac0J1QpVzUQwlzVDUWAROPEF3Pbv88wDkrFhM2qBBJKPHQ0IyHvHVvNhnxvYwEDNR79ejv7mTFa4SdeXvvt6qfYbTAfMIXWdOivzEt02lbz7zkeEet4LmlzTPntVJuKdTayEV8XnI+hT8X7xa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OxSLIpIdbRtQo7oWymIIhbXwZZEaUd7wVebusAe2RnlMNmlG6mfFs++T7h9KJVv5J7OjUMyzVmmc044Xo8kmUKsJN+Py0NrXoRkNZdRjznKAB61+Vmq7rBtiG4acYnoX0="

cache:
directories:
- ~/llvm
- "~/llvm"

matrix:
include:
Expand All @@ -17,11 +22,17 @@ matrix:
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./build_linux.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./build_osx.sh; fi
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LIBCLANG_STATIC_PATH=~/clang/lib; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LLVM_CONFIG_PATH=/clang/bin/llvm-config; fi
- cargo build --verbose --features "clang_3_8 static"
- RUST_TEST_THREADS=1 cargo test --verbose --features "clang_3_8 static"

script: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export LLVM_CONFIG_PATH=/clang/bin/llvm-config
export LIBCLANG_STATIC_PATH=~/clang/lib
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export LLVM_CONFIG_PATH=/clang/bin/llvm-config
export LIBCLANG_STATIC_PATH=/clang/lib
fi
cargo build --verbose --release --features "clang_3_8 static"
RUST_TEST_THREADS=1 cargo test --verbose --features "clang_3_8 static"
after_success: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
Expand All @@ -34,5 +45,49 @@ after_success: |
make &&
sudo make install &&
cd ../.. &&
RUST_TEST_THREADS=1 kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/cpp_codegen_rs-*;
RUST_TEST_THREADS=1 kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/cpp_codegen-*;
rm -rf master.tar.gz kcov-master
fi
before_deploy: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
mv target/release/cpp_codegen target/release/cpp_codegen_linux;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
mv target/release/cpp_codegen target/release/cpp_codegen_osx;
fi
deploy:
- provider: releases
api_key:
- secure: hEt0C0njTFYbJGWdC3gp0r+SmKC/rnhOi4OChc2p+bEH+2TIGltXxwyrwoicMikhHr2FhBwDiAgbEE85okcKxkYvBsAiH4PuiQBhzJq50QVHDcdW5HjZbBqWyYdANJrdkya68SbzjHKMSvf47W1HyX2uzGkEFSq4lp+GI8TZIZPy88XeHLOOT05XpBOJnOwIVpuH3ilP7bN1QeAM0OVc+aKJXYQkX5i0JG0eYnQXp8/QPfykmVXUSFzvDqP11eK+FPqtGbwKVkC9YpD9LtgOldylFTxJdWpa0UY05ttaKReaU2Ca7X0qIYn8/hG6GmI9PJNfj2awWczO4O2/1+mRxqbBDaW8syvXFoNRz0X54ZvWwJFLu3v3uTbUxnB0QwoV8s9mgRvaodw4idN2aBr141lHtjes8br+9QRRy74ND5Gg0eUFIG6NCaDnqDNIi+vyCNIB+d1ptMCXmOi+vazqrCjJ2oLeWULk29TDqyM5FIqxAdkADmHkSYA0rwzqHADMgaT5qhbBM/yGPgAySnvPxxTLAPQRUFW1SE9g/gQkSrivaJ58cxowCQXdmkb1M0E4MCaCkWP2UxYlr7fWEaVT2NyALFr98RD3nxVNUo+9mbRtqWx1JJuvzIPgCVdGGFUAB8DcBZNIBwKzHUDRmPqPmHwE9dl3qRoV5r4gjON3bdQ=
file: "target/release/cpp_codegen_linux"
skip_cleanup: true
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
- provider: releases
api_key:
- secure: hEt0C0njTFYbJGWdC3gp0r+SmKC/rnhOi4OChc2p+bEH+2TIGltXxwyrwoicMikhHr2FhBwDiAgbEE85okcKxkYvBsAiH4PuiQBhzJq50QVHDcdW5HjZbBqWyYdANJrdkya68SbzjHKMSvf47W1HyX2uzGkEFSq4lp+GI8TZIZPy88XeHLOOT05XpBOJnOwIVpuH3ilP7bN1QeAM0OVc+aKJXYQkX5i0JG0eYnQXp8/QPfykmVXUSFzvDqP11eK+FPqtGbwKVkC9YpD9LtgOldylFTxJdWpa0UY05ttaKReaU2Ca7X0qIYn8/hG6GmI9PJNfj2awWczO4O2/1+mRxqbBDaW8syvXFoNRz0X54ZvWwJFLu3v3uTbUxnB0QwoV8s9mgRvaodw4idN2aBr141lHtjes8br+9QRRy74ND5Gg0eUFIG6NCaDnqDNIi+vyCNIB+d1ptMCXmOi+vazqrCjJ2oLeWULk29TDqyM5FIqxAdkADmHkSYA0rwzqHADMgaT5qhbBM/yGPgAySnvPxxTLAPQRUFW1SE9g/gQkSrivaJ58cxowCQXdmkb1M0E4MCaCkWP2UxYlr7fWEaVT2NyALFr98RD3nxVNUo+9mbRtqWx1JJuvzIPgCVdGGFUAB8DcBZNIBwKzHUDRmPqPmHwE9dl3qRoV5r4gjON3bdQ=
file: "target/release/cpp_codegen_osx"
skip_cleanup: true
on:
tags: true
condition: "$TRAVIS_OS_NAME = osx"

after_deploy: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
git clone --quiet https://${GITHUB_VERSION_BUMP_API_KEY}@github.com/jupp0r/cpp-codegen-rs.git > /dev/null 2>&1 &&
cd cpp-codegen-rs &&
git checkout master &&
export LLVM_CONFIG_PATH=/clang/bin/llvm-config &&
export LIBCLANG_STATIC_PATH=~/clang/lib &&
cargo login ${CARGO_API_KEY} &&
sed -i "0,/version.*/s//version = \"${TRAVIS_TAG}\"/" Cargo.toml &&
git config --global user.email "[email protected]" &&
git config --global user.name "Travis CI" &&
git add Cargo.toml &&
git commit -m "Bump version to ${TRAVIS_TAG}" &&
cargo package &&
git push -u origin master > /dev/null 2>&1 &&
cargo publish
fi
18 changes: 12 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[package]
name = "cpp_codegen_rs"
version = "0.1.0"
name = "cpp_codegen"
version = "0.1.15"
description = "Generate Code from C++ classes"
homepage = "https://github.com/jupp0r/cpp-codegen-rs"
repository = "https://github.com/jupp0r/cpp-codegen-rs"
readme = "README.md"
authors = ["Jupp Müller <[email protected]>"]
license = "MIT"
build = "build.rs"
Expand All @@ -21,20 +25,20 @@ gte_clang_3_8 = []
gte_clang_3_9 = []

[dev-dependencies]
tempdir = "*"
tempdir = "0.3"

[build-dependencies]
serde_codegen = "*"
serde_codegen = "0.8"

[dependencies]
serde = "*"
serde_json = "*"
clap = "*"
rand = "*"
log = "*"
env_logger = "*"
clang = "*"
serde = "0.8"
serde_json = "0.8"
clap = "2"
rand = "0.3"
log = "0.3"
env_logger = "0.3"
clang = "0.12"

[dependencies.handlebars]
version = "*"
version = "0.20"
features = ["serde_type"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A Code Generator for C++ Interfaces [![Build Status](https://travis-ci.org/jupp0r/cpp-codegen-rs.svg?branch=master)](https://travis-ci.org/jupp0r/cpp-codegen-rs)[![Build status](https://ci.appveyor.com/api/projects/status/nov0lxhgce7dwjvl/branch/master?svg=true)](https://ci.appveyor.com/project/jupp0r/cpp-codegen-rs/branch/master)[![Coverage Status](https://coveralls.io/repos/github/jupp0r/cpp-codegen-rs/badge.svg?branch=master)](https://coveralls.io/github/jupp0r/cpp-codegen-rs?branch=master)
Generate Code from C++ Classes [![Build Status](https://travis-ci.org/jupp0r/cpp-codegen-rs.svg?branch=master)](https://travis-ci.org/jupp0r/cpp-codegen-rs)[![Build status](https://ci.appveyor.com/api/projects/status/nov0lxhgce7dwjvl/branch/master?svg=true)](https://ci.appveyor.com/project/jupp0r/cpp-codegen-rs/branch/master)[![Coverage Status](https://coveralls.io/repos/github/jupp0r/cpp-codegen-rs/badge.svg?branch=master)](https://coveralls.io/github/jupp0r/cpp-codegen-rs?branch=master)
===================================
cpp-codegen-rs uses libclang to read C++ class definitions and
generate code. Example use cases include the generation of Google Mock
Expand Down Expand Up @@ -77,7 +77,7 @@ also deals with namespaces and class templates, can be found in
In order to perform the actual compilation, cpp-codegen-rs is invoked with the following parameters
``` bash
cpp_codegen_rs interface.h -t templates/gmock.hbs
cpp_codegen interface.h -t templates/gmock.hbs
```

Generated code is written to stdout.
Expand Down
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@ install:

build_script:
- cargo build --verbose --release --features clang_3_8
- md deploy
- move target\release\cpp_codegen.exe deploy\cpp_codegen_windows.exe
- copy C:\LLVM\bin\libclang.dll deploy\libclang.dll
- 7z a cpp_codegen_windows.zip .\deploy\*.*

test_script:
- set RUST_BACKTRACE=1
- set RUST_TEST_THREADS=1
- cargo test --verbose -- --nocapture

artifacts:
- path: cpp_codegen_windows.zip
name: Releases

deploy:
description: ''
provider: GitHub
auth_token:
secure: aFuuIGpdj5nf4v6gDDv1bfL3Jhkk4ktsY3SC0WICL+2w2RDOH/xK1HVq2Dl3Ehnp
artifact: cpp_codegen_windows.zip
on:
appveyor_repo_tag: true

0 comments on commit 0fc2255

Please sign in to comment.