-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatic Clojush releases on every travis build
- Loading branch information
1 parent
6288858
commit c940987
Showing
7 changed files
with
104 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 1,13 @@ | ||
sudo: false | ||
sudo: true | ||
language: clojure | ||
|
||
# https://github.com/technomancy/leiningen/issues/2014#issuecomment-153829977 | ||
before_install: yes y | sudo lein upgrade | ||
|
||
script: | ||
# check fails because of "Duplicate Push instruction defined:boolean_and" | ||
# - lein check | ||
- lein test | ||
after_success: | ||
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && ./deploy-docs.sh | ||
|
||
after_success: ./scripts/after_success.sh 2>&1 | sed "s/$GITHUB_TOKEN/<hidden github token>/" | ||
notifications: | ||
email: false |
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 |
---|---|---|
@@ -0,0 1,48 @@ | ||
# Contributing | ||
|
||
[Here](https://gist.github.com/thelmuth/1361411) is a document describrining how | ||
to contribute to this project. | ||
|
||
## Travic CI | ||
Recently we have begun using [Travis CI](travis-ci.org) to automate multiple | ||
parts of development. | ||
|
||
### Testing | ||
|
||
Primarily it serves as a way to test every branch and pull request, using commands | ||
like `lein check` and `lein test`. Currently, the test cases are very limited | ||
and do not cover much of the codebase. | ||
|
||
### Docs | ||
|
||
Docs are auto generated from function metadata using | ||
[`codox`](https://github.com/weavejester/codox). | ||
|
||
On every commit to master, the docs are automatically regenerated and pushed | ||
to the [`gh-pages` branch](http://lspector.github.io/Clojush/). | ||
|
||
To generate them locally run `lein doc` and then open `doc/index.html`. | ||
|
||
Currently, generating the docs have the side effect of running some examples, | ||
[because I couldn't figure out how stop codox from loading all example files](https://github.com/weavejester/codox/issues/100). | ||
|
||
In the metadata, you can [skip functions](https://github.com/weavejester/codox#metadata-options) | ||
and also [link to other functions](https://github.com/weavejester/codox#docstring-formats). | ||
|
||
In order for this work, you must set the `GITHUB_TOKEN` environmental variable | ||
in the [repository settings in Travis](http://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings). | ||
It needs this so it can push the updated docs back to Github. | ||
|
||
### Releases | ||
|
||
We use [the `lein release` command](https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md#releasing-simplified) | ||
to add a new release on every build on the `master` branch. Check the | ||
`:release-tasks` key in the [`project.clj`](./project.clj) for a list of | ||
all steps it takes. | ||
|
||
This requires setting the `LEIN_USERNAME` and `LEIN_PASSWORD` in | ||
the [repository settings in Travis](http://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings), | ||
so that it can the release to Clojars. It also needs the `GITHUB_TOKEN` | ||
in order to push the added tag and commit back to Github. | ||
|
||
Currently it will always bump a minor version. It |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 1,31 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit | ||
set -o nounset | ||
set -o xtrace | ||
set -o pipefail | ||
|
||
LAST_COMMIT_AUTHOR_EMAIL=$(git --no-pager show -s --format='�' HEAD) | ||
echo "last commit ID: $LAST_COMMIT_AUTHOR_EMAIL" | ||
AUTOMATED_AUTHOR_EMAIL=_@_._ | ||
AUTOMATED_AUTHOR_NAME=_ | ||
|
||
# if this commit was a created automatically (by lein release) then we dont | ||
# wanna re release it. If it is, exit. | ||
test $TRAVIS_PULL_REQUEST == "false" && \ | ||
test $TRAVIS_BRANCH == "master" && | ||
test $LAST_COMMIT_AUTHOR_EMAIL != $AUTOMATED_AUTHOR_EMAIL | ||
|
||
git remote set-url origin https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git | ||
git branch --set-upstream-to origin/master master | ||
git config user.name "$AUTOMATED_AUTHOR_NAME" | ||
git config user.email "$AUTOMATED_AUTHOR_EMAIL" | ||
git config push.default simple | ||
# dont output all of lein doc, because its overly long because it tries | ||
# to run experiments | ||
lein doc 2>&1 | head -n 100 | ||
./scripts/deploy-docs.sh --verbose | ||
git checkout master | ||
git status | ||
git branch | ||
lein release | ||
git tag |
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