-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbb.edn
55 lines (51 loc) · 2.34 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
{:paths ["bb"]
:tasks
{:requires ([clojure.string :as string]
[changelog])
:init
(do
(defn shell-and-log
([x] (shell-and-log {} x))
([opts x]
(println x)
(when (seq opts) (println opts))
(shell opts x))))
test (shell-and-log (str "./addons/gdUnit4/runtest.sh -c -a test"))
test-match (let [arg (some-> *command-line-args* first)]
(shell-and-log (str "./addons/gdUnit4/runtest.sh -c -a " arg)))
release
(let [tag (some-> *command-line-args* first)]
(if-not tag
(do
(println "Ensure tests are passing")
(println "Ensure empty diff")
(println "Update version in addons/log/plugin.cfg")
(println "Run `bb release <new-version-tag-like-v0.0.5>`")
(println "Create release on github")
(println "Submit updated version number to the asset store"))
(let [plugin-cfg (slurp "addons/log/plugin.cfg")]
(if (not (string/includes? plugin-cfg (str "version=\"" tag "\"")))
(println "plugin.cfg version does not match passed tag" tag)
(do
(println "Run `bb changelog <new-version-tag>` to update the Changelog.md")
(changelog/rewrite-changelog {:latest-tag-label tag})
(println "Stage expected files (plugin.cfg and changelog.md)")
(shell-and-log "git add addons/log/plugin.cfg")
(shell-and-log "git add CHANGELOG.md")
(shell-and-log (str "git commit -m 'release: new version: " tag "'"))
(shell-and-log (str "git tag " tag))
(shell-and-log (str "git push origin " tag))
(shell-and-log (str "git push"))
(println "TODO: Create release on github!")
(println "TODO: Submit updated version number to the asset store"))))))
changelog (let [tag-overwrite (some-> *command-line-args* first)]
(changelog/rewrite-changelog {:latest-tag-label tag-overwrite})
(changelog/rewrite-changelog {:latest-tag-label tag-overwrite
:path "docs/changelog.md"})
;; TODO commit optional
(shell-and-log "git add CHANGELOG.md")
(shell-and-log "git commit -m 'docs: update changelog'"))
gd-plug
(shell-and-log
(str "godot --no-window -s plug.gd " (string/join " " *command-line-args*)))
}}