-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.clj
36 lines (31 loc) · 890 Bytes
/
build.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(ns build
(:require
[clojure.string :as str]
[org.corfield.build :as bb]))
(def lib 'com.github.ingesolvoll/re-statecharts)
(def version "0.0.1")
(defn install [opts]
(-> opts
(assoc :lib lib :version version)
(bb/jar)
(bb/install)))
(def release-marker "Release-")
(defn extract-version [tag]
(str/replace-first tag release-marker ""))
(defn maybe-deploy [opts]
(if-let [tag (System/getenv "CIRCLE_TAG")]
(do
(println "Found tag " tag)
(if (re-find (re-pattern release-marker) tag)
(do
(println "Releasing to clojars...")
(-> opts
(assoc :lib lib :version (extract-version tag))
(bb/jar)
(bb/deploy)))
(do
(println "Tag is not a release tag, skipping deploy")
opts)))
(do
(println "No tag found, skipping deploy")
opts)))