diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..827a7a9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: common-lisp +sudo: enabled +os: + - linux + - osx +dist: xenial +addons: + homebrew: + packages: sbcl +install: ./scripts/install-deps.sh +script: ./scripts/build.sh +before_deploy: ./scripts/create-dist.sh +deploy: + provider: releases + api_key: + secure: J1kh7HgydJYsENltYiz4LHspQZU/Zd+zPsLfF3euf8aD1P7TVRH71F4qUqq1z3LYOfWTnYGO/GN7YJg+LBpfTYz/Z95qJwIZlha1c+KF/FVaqzz8ge5FznLVE72zhxv06hRk8+K8O0IDlKcZw8L27cTTvvoebC3IuU0mSsY1EtmsCzu6uPEnXl3aObS8dsN4CuNpz54rK7jtzo9T9hkQXnPLM2G7D4AlkqiwTHQGVMODKM/CPZdgkhGssWrRyt4eunK2LjQ4gxZBxjStXsTthF+6ZLDhHNT9+oqiFHardX8O4aRDYNsvceh0FoYK4rZyGEpE3HfhZqKTxV6AXTI6NFI6v6C8mMp74ZShUqyPh8zq5/rBuztMpbsbOLz8QK/SL0Yr2heZGQeprs71+C1Y6gKXppwNZdA0wmhYilGtXS5mwgkZRxMT/aTiZ8h8EMUiFKfPTi1U5zCfib4mSrPnJAuFkwHHZ77/ElIK0IV6U7DK9TLqPDBio/AdtX7R98Vpq7clLReYuqT045w5GWcJgQRH9QPRTmN0Y5J3let7ah4AuStrvqkLghFRL41vet2Lltsqu7sq6m5cyYxoEDF7RCY91mGy9qOE1cew1nznxJuABFO4x9/mEOkQ0ri0JxOcT9+C4XvRm/AzFjq/wxqZVhj5L/kPMPDHeC2cFVaaRZw= + file_glob: true + file: build/*.tar.gz + skip_cleanup: true + on: + tags: true diff --git a/build-image.lisp b/build-image.lisp deleted file mode 100644 index 8ae3641..0000000 --- a/build-image.lisp +++ /dev/null @@ -1,3 +0,0 @@ -(ql:quickload "deftask-cli") -(deftask-cli:build-image) - diff --git a/deftask-cli.lisp b/deftask-cli.lisp index b618266..80dc40c 100644 --- a/deftask-cli.lisp +++ b/deftask-cli.lisp @@ -738,6 +738,13 @@ Filter and re-order tasks using -q and -o respectively. (deftask:edit-comment (second argv) (third argv) (fourth argv)) (format t "Edited comment #~A~%" (third argv)))) +;;; version + +(defun command-version (argv) + (declare (ignore argv)) + (write-string #.(asdf:component-version (asdf:find-system "deftask-cli"))) + (terpri)) + ;; pager (defun launch-pager (name &rest args) diff --git a/scripts/build-image.lisp b/scripts/build-image.lisp new file mode 100644 index 0000000..e290245 --- /dev/null +++ b/scripts/build-image.lisp @@ -0,0 +1,11 @@ +(push *default-pathname-defaults* asdf:*central-registry*) +(ql:quickload "cffi-grovel") ; https://github.com/quicklisp/quicklisp-client/issues/108 +(ql:quickload "deftask-cli") + +(defvar *build-dir* + (let ((os (or (deftask-cli::getenv "TRAVIS_OS_NAME") + (string-downcase (uiop/os:operating-system))))) + (assert os nil "No OS given") + (ensure-directories-exist (format nil "build/~A/" os)))) + +(deftask-cli:build-image (make-pathname :name "deftask" :defaults *build-dir*)) diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..672ee8e --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sbcl --disable-debugger --load scripts/build-image.lisp diff --git a/scripts/create-dist.sh b/scripts/create-dist.sh new file mode 100755 index 0000000..212bf31 --- /dev/null +++ b/scripts/create-dist.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +OS=$TRAVIS_OS_NAME +VERSION=$(build/$OS/deftask version) + +DIST_NAME=deftask-cli-$OS-v$VERSION +DIST_DIR=build/$DIST_NAME +mv build/$OS $DIST_DIR + +TARBALL=$DIST_NAME.tar.gz + +cp README.md $DIST_DIR/ +cd build +tar czvf $TARBALL $DIST_NAME/* +cd - +ls build +tar tzvf build/$TARBALL diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh new file mode 100755 index 0000000..0d2d769 --- /dev/null +++ b/scripts/install-deps.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + export SB_DIST=sbcl-1.4.13-x86-64-linux + export TARBALL=$SB_DIST-binary.tar.bz2 + wget http://prdownloads.sourceforge.net/sbcl/$TARBALL + tar -xjvf $TARBALL + cd $SB_DIST + sudo sh install.sh + cd - +fi + +curl -O https://beta.quicklisp.org/quicklisp.lisp + +sbcl --disable-debugger --load quicklisp.lisp --eval '(quicklisp-quickstart:install)' --eval '(setf ql-util::*do-not-prompt* t)' --eval '(ql:add-to-init-file)' --quit + +cd ~/quicklisp/local-projects/ +git clone https://github.com/chaitanyagupta/termcolor.git