From 3ebe2732c1c5a0a06d75a111d5776b75e1dfaf74 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sun, 22 Aug 2021 19:30:15 -0700 Subject: [PATCH] update tools.build; add deploy via build --- build.clj | 8 +++++++- deps.edn | 14 +++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/build.clj b/build.clj index e029fe8..20b4273 100644 --- a/build.clj +++ b/build.clj @@ -9,7 +9,8 @@ clojure -A:deps -T:build help/doc" (:require [clojure.tools.build.api :as b] - [clojure.tools.deps.alpha :as t])) + [clojure.tools.deps.alpha :as t] + [deps-deploy.deps-deploy :as dd])) (def lib 'com.github.seancorfield/next.jdbc) (def version (format "1.2.%s" (b/git-count-revs nil))) @@ -49,3 +50,8 @@ (defn ci "Run the CI pipeline of tests (and build the JAR)." [opts] (-> opts (run-tests) (clean) (jar))) + +(defn deploy "Deploy the JAR to Clojars." [opts] + (dd/deploy (merge {:installer :remote :artifact jar-file + :pom-file (b/pom-path {:lib lib :class-dir class-dir})} + opts))) diff --git a/deps.edn b/deps.edn index 9889b30..82ded8e 100644 --- a/deps.edn +++ b/deps.edn @@ -5,7 +5,8 @@ camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}} :aliases {;; for help: clojure -A:deps -T:build help/doc - :build {:deps {io.github.clojure/tools.build {:git/tag "v0.1.8" :git/sha "38d2780"}} + :build {:deps {io.github.clojure/tools.build {:git/tag "v0.1.9" :git/sha "6736c83"} + io.github.slipset/deps-deploy {:sha "b4359c5d67ca002d9ed0c4b41b710d7e5a82e3bf"}} :ns-default build} ;; running tests/checks of various kinds: @@ -43,13 +44,4 @@ org.apache.logging.log4j/log4j-jul {:mvn/version "2.14.1"} org.apache.logging.log4j/log4j-slf4j-impl {:mvn/version "2.14.1"}} :jvm-opts ["-Dlog4j2.configurationFile=log4j2-info.properties"] - :exec-fn cognitect.test-runner.api/test} - - ;; first run: clojure -T:build ci - ;; then: clojure -T:deploy target/n - :deploy - {:deps {slipset/deps-deploy {:git/url "https://github.com/slipset/deps-deploy" - :sha "b4359c5d67ca002d9ed0c4b41b710d7e5a82e3bf"}} - :exec-fn deps-deploy.deps-deploy/deploy - :exec-args {:installer :remote - :pom-file "target/classes/META-INF/maven/com.github.seancorfield/next.jdbc/pom.xml"}}}} + :exec-fn cognitect.test-runner.api/test}}}