forked from babashka/neil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
58 lines (58 loc) · 3.04 KB
/
bb.edn
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{:paths ["src" "dev" "test"]
:pods {org.babashka/fswatcher {:version "0.0.3"}}
:deps {org.babashka/neil {:local/root "."}}
:bbin/bin {neil {:main-opts ["-f" "neil"]}}
:tasks {:requires ([babashka.fs :as fs]
[clojure.string :as str]
[selmer.parser :as p]
[selmer.util :refer [without-escaping]])
dev {:doc "Starts watcher to auto-build neil script"
:requires ([babashka.neil.dev :as dev])
:task (dev/dev)}
ci {:doc "Run all CI tasks locally"
:requires ([taoensso.timbre :as log])
:task (do
(log/info "bb run lint")
(run 'lint)
(log/info "bb run tests")
(run 'tests)
(log/info "bb run tests-emacs")
(run 'tests-emacs))}
lint (shell "clj-kondo --lint .")
gen-script {:doc "Build the neil script"
:requires ([babashka.neil.gen-script :as gen-script])
:task (gen-script/gen-script)}
bump-version {:requires ([babashka.neil :as neil]
[clojure.edn :as edn])
:task (let [version (-> (slurp "deps.edn") edn/read-string
:aliases :neil :project :version)
[major minor patch] (str/split version (re-pattern "\\."))
version (str/join "." [major minor (inc (Integer/parseInt patch))])]
(binding [*command-line-args* ["version" "set" version "--no-tag"]]
(neil/-main)))}
update-readme {:depends [gen-script]
:task (let [help (:out (shell {:out :string} "./neil"))]
(without-escaping
(->> (p/render (slurp "README.template.md")
{:help (str/trim help)})
(spit "README.md"))))}
tests {:depends [gen-script]
:requires ([babashka.neil.test-runner])
:task (exec 'babashka.neil.test-runner/run-tests)}
tests-emacs {:extra-paths ["."]
:requires ([tests-emacs :as te])
:task (te/run-tests)}
publish {:requires ([clojure.edn :as edn])
:doc "Bumps version, pushes tag"
:task
(do
(run 'bump-version)
(run 'tests)
(run 'update-readme)
(shell "git add .")
(let [version (-> (slurp "deps.edn") edn/read-string
:aliases :neil :project :version)]
(shell (format "git commit -m 'Bump version %s'" version))
(shell (str "git tag v" version))
(shell "git push --atomic origin main"
(str "v" version))))}}}