Skip to content

Commit

Permalink
Deploy on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
RickMoynihan committed Jan 4, 2022
1 parent 2669171 commit 9fea63e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 7 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ jobs:
workflows:
build-workflow:
jobs:
- test
- test:
filters: # required since `deploy` has tag filters AND requires `test`
tags:
only: /.*/
- deploy:
context:
- clojars-publisher
filters:
tags:
only: /^v.*/
branches:
only:
- master
ignore: /.*/
requires:
- test
14 changes: 5 additions & 9 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
(:refer-clojure :exclude [test]))

(def lib 'grafter/matcha.alpha)
(def version (format "0.2.%s" (b/git-count-revs nil)))
(def version (System/getenv "CIRCLE_TAG"))

(def jar-file (format "target/%s-%s.jar" (name lib) version))

(defn test
Expand All @@ -29,16 +30,11 @@
(assoc :lib lib :version version)
(bb/install)))

(defn tag [{:keys [version] :as opts}]
(let [vtag (str "v" version)]
(b/git-process {:git-args ["tag" vtag]})
(b/git-process {:git-args ["push" "origin" vtag]}))
opts)

(defn deploy
"Deploy the JAR to Clojars."
"Deploy the JAR to Clojars.
NOTE: this expects a tag to be set; typically done via the github release UI."
[opts]
(-> opts
(assoc :lib lib :version version)
(tag)
(bb/deploy)))

0 comments on commit 9fea63e

Please sign in to comment.