-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbb.edn
35 lines (30 loc) · 1.25 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
{:paths ["src"]
:deps
{io.lambdaforge/datalog-parser {:mvn/version "0.1.11"}
me.tagaholic/dlint {:mvn/version "0.1.0"}}
:tasks
{:requires ([clojure.string :as str])
;; Publish tasks copied from nbb
publish {:doc "Bump to version, pushes tag and lets CI publish to npm."
:task
(let [version (or (first *command-line-args*)
(throw (ex-info "No version given!" {})))]
(shell "npm version" version)
(shell "git push --atomic origin main" (str "v" version)))}
current-tag (->> (shell {:out :string} "git describe")
:out
str/trim
(re-matches (re-pattern "^v\\d+\\.\\d+\\.\\d+")))
current-branch (->> (shell {:out :string} "git rev-parse --abbrev-ref HEAD")
:out
str/trim)
ci:is-release {:depends [current-tag current-branch]
:task (and current-tag (= "main" current-branch))}
ci:publish {:doc "Publishes release build to npm"
:depends [ci:is-release]
:task
(if ci:is-release
(do
(println "Releasing")
(shell "npm publish"))
(println "Skipping release."))}}}