-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
bb.edn
63 lines (57 loc) · 2.86 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
59
60
61
62
63
{:pods {clj-kondo/clj-kondo {:version "2022.05.31"}}
:deps {io.github.borkdude/quickdoc
#_{:local/root "/Users/borkdude/dev/quickdoc"}
{:git/sha "d5313344c97b79f014a90634313b5fd2205938af"}
current/deps {:local/root "."}
io.github.borkdude/gh-release-artifact
{:git/sha "4a9a74f0e50e897c45df8cc70684360eb30fce80"}}
:paths [".build"]
:tasks
{:requires ([clojure.edn :as edn]
[clojure.string :as str]
[babashka.cli :as cli]
[utils])
:init (def cmd-line-opts
(cli/parse-opts *command-line-args*
{:coerce {:toc parse-boolean
:skip-bump parse-boolean}}))
quickdoc {:doc "Invoke quickdoc"
:requires ([quickdoc.api :as api])
:task (let [{:keys [markdown]}
(api/quickdoc {:toc true
:git/branch "main"
:github/repo "https://github.com/babashka/http-server"})])}
package-jar {:doc "Prepare jar for packages"
:task (do
(println "Producing uberjar")
(shell "bb --config .build/uberjar.edn --deps-root .
uberjar http-server.jar -m babashka.http-server"))}
upload-jar {:doc "Upload jar to release"
:depends [package-jar]
:requires ([borkdude.gh-release-artifact :as ghr])
:task (do
(println "Uploading jar" (str "v" (utils/format-version)))
(ghr/overwrite-asset {:org "babashka"
:repo "http-server"
:file "http-server.jar"
:draft false
:overwrite true
:tag (str "v" (utils/format-version))}))}
tag {:doc "Create and push tag"
:task (do (shell "git tag" (str "v" (utils/format-version)))
(shell "git push --atomic" "origin" "main" (str "v" (utils/format-version))))}
bump-release {:doc "Bump release counter"
:task (let [old-version (utils/format-version)]
(utils/bump-version)
(spit "README.md" (str/replace (slurp "README.md")
old-version
(utils/format-version)))
(shell "git add version.edn README.md")
(shell "git commit -m" (str "v" (utils/format-version))))}
publish {:doc "Bump release count and publish to clojars"
:task (do
(println "Uploading jar")
(run 'upload-jar)
(clojure "-T:build deploy")
)}
}}