-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbb.edn
57 lines (46 loc) · 2.56 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
{:paths ["." "script"]
:deps {lread/status-line {:git/url "https://github.com/lread/status-line.git"
:sha "cf44c15f30ea3867227fa61ceb823e5e942c707f"}
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
version-clj/version-clj {:mvn/version "2.0.3"}}
:tasks {;; setup
:requires ([babashka.fs :as fs]
[build-shared :as shared]
[clojure.string :as string]
[helper.shell :as shell]
[lread.status-line :as status])
:enter (let [{:keys [name accepts-args?]} (current-task)]
(when-not (string/starts-with? name "-")
(status/line :head "TASK %s %s" name (string/join " " *command-line-args*))))
:leave (let [{:keys [name]} (current-task)]
(when-not (string/starts-with? name "-")
(status/line :detail "\nTASK %s done." name)))
;; commands
clean {:doc "Delete any build work"
:task (when (fs/exists? "target")
(fs/delete-tree "target"))}
cljdoc-preview {:doc "Preview what docs will look like on cljdoc, use --help for args"
:task cljdoc-preview/-main}
jar {:doc "Create jar"
:task (shell/command "clojure -T:build jar")}
install {:depends [jar]
:doc "Install jar locally"
:task (shell/command "clojure -T:build install")}
release {:doc "Tell CI to release to clojars"
:task release/-main}
outdated {:doc "Check for outdated dependencies"
:task (shell/command {:continue true} "clojure -M:outdated")}
;; Tasks run on GitHub Actions
-ci-release (and (not (shared/ci-release?))
(status/die 1 "Must be run from CI service"))
-built-version (-> (shell/command {:out :string}
"clojure -T:build built-version")
:out
string/trim)
-ci-version {:depends [-ci-release -built-version]
:task (let [tag-version (str "v" -built-version)]
(println "Tagging repo with:" tag-version)
(shell/command "git tag -a" tag-version "-m" (str "Release " tag-version))
(shell/command "git push origin" tag-version))}
-ci-deploy {:depends [-ci-release]
:task (shell/command "clojure -T:build ci-deploy")}}}