Skip to content

Commit 3618ed0

Browse files
committed
Add task to tag a release
This also changes the release versioning format from an incrementing number to <date>.<commit-count>.
1 parent d1794ed commit 3618ed0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ prep-deps:
2222
repl:
2323
clj -A:defaults:dev
2424

25+
.PHONY: tag-release
26+
tag-release:
27+
clj -T:build tag-release
28+
2529
.PHONY: test
2630
test:
2731
./bin/kaocha

build.clj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
(java.time
66
LocalDate)))
77

8-
;; TODO: (toby) add a task to tag & push a release
9-
(def version (format "%s.%s" (LocalDate/now) (b/git-count-revs nil)))
108
(def class-dir "target/classes")
119
(def basis (b/create-basis {:aliases [:default]}))
1210
(def uber-file "target/clojars-web-standalone.jar")
@@ -27,3 +25,10 @@
2725
:uber-file uber-file
2826
:basis basis
2927
:main 'clojars.main}))
28+
29+
(def version (format "%s.%s" (LocalDate/now) (b/git-count-revs nil)))
30+
31+
(defn tag-release [_]
32+
(printf "Tagging release version %s...\n" version)
33+
(b/git-process {:git-args (format "tag %s" version)})
34+
(b/git-process {:git-args (format "push origin %s" version)}))

0 commit comments

Comments
 (0)