Skip to content

Commit

Permalink
Merge pull request #44 from pmonks/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pmonks authored Jul 25, 2022
2 parents 90d7b41 + 7007dc4 commit 8df7564
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- uses: DeLaGuardo/setup-clojure@5.1
- uses: DeLaGuardo/setup-clojure@9.3
with:
cli: latest
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- uses: DeLaGuardo/setup-clojure@5.1
- uses: DeLaGuardo/setup-clojure@9.3
with:
cli: latest
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- uses: DeLaGuardo/setup-clojure@5.1
- uses: DeLaGuardo/setup-clojure@9.3
with:
cli: latest
- uses: actions/cache@v3
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ To use the turnkey build script, include the following alias in your project's `
```edn
{:deps { ; Your project's dependencies
}
:aliases {:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.8.0" :git/sha "9bd8b8a"}
com.github.pmonks/pbr {:mvn/version "RELEASE"}}
:ns-default pbr.build}}}
:aliases {:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.8.2" :git/sha "0ffdb4c"}
com.github.pmonks/pbr {:mvn/version "RELEASE"}}
:ns-default pbr.build
:extra-paths ["src"]}}} ; To appease codox, which is poorly integrated with tools.deps/tools.build...
```

Note that despite not using it directly, you must express an explicit dependency on `io.github.seancorfield/build-clj` in your build alias, as that project [doesn't publish artifacts to Clojars](https:/seancorfield/build-clj/issues/11) and transitive git coordinate dependencies are not supported by tools.deps.
Expand Down
20 changes: 10 additions & 10 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
;

{:deps
{org.clojure/tools.deps.alpha {:mvn/version "0.14.1178"}
{org.clojure/tools.deps.alpha {:mvn/version "0.14.1212"}
org.clojure/data.json {:mvn/version "2.4.0"}
io.github.clojure/tools.build {:git/tag "v0.8.2" :git/sha "ba1a2bf"}
io.github.seancorfield/build-clj {:git/tag "v0.8.0" :git/sha "9bd8b8a"}
com.github.pmonks/tools-convenience {:mvn/version "1.0.100"}
com.github.pmonks/tools-pom {:mvn/version "1.0.89"}
com.github.pmonks/tools-licenses {:mvn/version "1.0.110"}
com.github.liquidz/antq {:mvn/version "1.6.1"}
clj-kondo/clj-kondo {:mvn/version "2022.04.25"}
io.github.clojure/tools.build {:git/tag "v0.8.3" :git/sha "0d20256"}
io.github.seancorfield/build-clj {:git/tag "v0.8.3" :git/sha "7ac1f8d"}
com.github.pmonks/tools-convenience {:mvn/version "1.0.109"}
com.github.pmonks/tools-pom {:mvn/version "1.0.98"}
com.github.pmonks/tools-licenses {:mvn/version "1.0.118"}
com.github.liquidz/antq {:mvn/version "1.9.867"}
clj-kondo/clj-kondo {:mvn/version "2022.06.22"}
codox/codox {:mvn/version "0.10.8"}

; Dynamic dependencies - any time any of these changes it MUST ALSO BE CHANGED IN pbr.tasks!!
Expand All @@ -34,10 +34,10 @@
org.slf4j/jcl-over-slf4j {:mvn/version "1.7.36"}
org.slf4j/log4j-over-slf4j {:mvn/version "1.7.36"}
org.slf4j/jul-to-slf4j {:mvn/version "1.7.36"}
jonase/eastwood {:mvn/version "1.2.3"}
jonase/eastwood {:mvn/version "1.2.4"}
com.github.athos/clj-check {:git/sha "518d5a1cbfcd7c952f548e6dbfcb9a4a5faf9062"}
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:aliases
{:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.8.0" :git/sha "9bd8b8a"}
{:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.8.3" :git/sha "7ac1f8d"}
com.github.pmonks/pbr {:local/root "."}}
:ns-default pbr.build}}}
17 changes: 12 additions & 5 deletions src/pbr/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
(def ^:private ver-test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}) ; Latest version of https:/cognitect-labs/test-runner
(def ^:private ver-logback {:mvn/version "1.2.11"})
(def ^:private ver-slf4j {:mvn/version "1.7.36"})
(def ^:private ver-eastwood {:mvn/version "1.2.3"})
(def ^:private ver-eastwood {:mvn/version "1.2.4"})

(defn github-url
"Returns the base GitHub URL for the given lib (a namespaced symbol), or nil if it can't be determined. Note: this is a utility fn, not a task fn."
Expand Down Expand Up @@ -336,9 +336,9 @@
(tc/git :push "origin" "-f" "--tags")

(println "ℹ️ Creating 'release' pull request from" dev-branch " to " prod-branch "...")
(let [pr-desc-fmt (get opts :pr-desc "%1$s release v%2$s. See commit log for details of what's included in this release.")]
(let [pr-desc-fmt (get opts :pr-desc "%1$s release %2$s. See commit log for details of what's included in this release.")]
(tc/exec ["hub" "pull-request" "--browse" "-f"
"-m" (str "Release v" version)
"-m" (str "Release " version)
"-m" (format pr-desc-fmt (str lib) (str version))
"-h" dev-branch "-b" prod-branch]))

Expand All @@ -362,11 +362,18 @@
(let [current-branch (tc/git-current-branch)
main-branch (get opts :prod-branch "main")]
(if (= current-branch main-branch)
(let [deploy-opts (assoc opts :version (tc/git-nearest-tag)
(let [version (tc/git-nearest-tag)
deploy-opts (assoc opts :version version
:write-pom true
:validate-pom true)]
(println "ℹ️ Deploying" (:lib deploy-opts) "version" (:version deploy-opts) "to Clojars.")
(pom/pom deploy-opts)
; If we're using git, always ensure there's a <tag> element inside the <scm> element - leaving it out causes
; either deps-deploy or Clojars (undetermined which) to default it to an invalid value, which then breaks
; downstream tooling (e.g. cljdoc)
(if (and (not (get-in opts [:pom :scm :tag]))
(s/starts-with? (get-in opts [:pom :scm :connection] "") "scm:git"))
(pom/pom (assoc-in opts [:pom :scm :tag] version))
(pom/pom opts))
(bb/jar deploy-opts)
(bb/deploy deploy-opts))
(throw (ex-info (str "deploy task must be run from '" main-branch "' branch (current branch is '" current-branch "').") (into {} opts)))))
Expand Down

0 comments on commit 8df7564

Please sign in to comment.