Skip to content

Commit

Permalink
Simplified build script, removed 1.9 support and aot
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Feb 13, 2021
1 parent d1195cb commit 82487ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
15 changes: 0 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
version: 2
jobs:
test_clj_9:
working_directory: ~/datascript
docker:
- image: circleci/clojure:lein
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "project.clj" }}
- run: lein with-profile 1.9 test-clj
- save_cache:
key: dependency-cache-{{ checksum "project.clj" }}
paths:
- ~/.m2

test_clj_10:
working_directory: ~/datascript
docker:
Expand Down Expand Up @@ -61,7 +47,6 @@ workflows:
version: 2
everything:
jobs:
- test_clj_9
- test_clj_10
- build_cljs
- test_cljs:
Expand Down
6 changes: 1 addition & 5 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:url "https://github.com/tonsky/datascript"

:dependencies [
[org.clojure/clojure "1.10.0" :scope "provided"]
[org.clojure/clojure "1.10.2" :scope "provided"]
[org.clojure/clojurescript "1.10.520" :scope "provided"]
[persistent-sorted-set "0.1.2"]
]
Expand Down Expand Up @@ -88,15 +88,11 @@
]}

:profiles {
:1.9 { :dependencies [[org.clojure/clojure "1.9.0" :scope "provided"]
[org.clojure/clojurescript "1.9.946" :scope "provided"]] }
:dev { :source-paths ["test" "dev"]
:dependencies [[org.clojure/tools.nrepl "0.2.13"]
[org.clojure/tools.namespace "0.2.11"]
[lambdaisland/kaocha "0.0-389"]
[lambdaisland/kaocha-cljs "0.0-21"]] }
:aot { :aot [#"datascript\.(?!query-v3).*"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"] }
}

:clean-targets ^{:protect false} [
Expand Down
16 changes: 6 additions & 10 deletions script/release.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env clojure
#!/usr/bin/env clj

"USAGE: ./release.clj <new-version>"

Expand All @@ -19,11 +19,9 @@
(defn current-version []
(second (re-find #"def version \"([0-9\.]+)\"" (slurp "project.clj"))))

(def ^:dynamic *env* {})

(defn sh [& args]
(apply println "Running" (if (empty? *env*) "" (str :env " " *env*)) args)
(let [res (apply sh/sh (concat args [:env (merge (into {} (System/getenv)) *env*)]))]
(apply println "Running" args)
(let [res (apply sh/sh args)]
(if (== 0 (:exit res))
(do
(println (:out res))
Expand Down Expand Up @@ -83,7 +81,7 @@
(str/join ",\n"))
" }"))

(def GITHUB_AUTH (System/getenv "GITHUB_AUTH"))
(def GITHUB_BASIC (System/getenv "GITHUB_BASIC"))

(defn github-release []
(sh "cp" "release-js/datascript.js" (str "release-js/datascript-" new-v ".min.js"))
Expand All @@ -98,12 +96,12 @@
"name" new-v
"target_commitish" "master"
"body" changelog}
response (sh "curl" "-u" GITHUB_AUTH
response (sh "curl" "-u" GITHUB_BASIC
"-X" "POST"
"--data" (map->json request)
"https://api.github.com/repos/tonsky/datascript/releases")
[_ id] (re-find #"\"id\": (\d+)" response)]
(sh "curl" "-u" GITHUB_AUTH
(sh "curl" "-u" GITHUB_BASIC
"-X" "POST"
"-H" "Content-Type: application/javascript"
"--data-binary" (str "@release-js/datascript-" new-v ".min.js")
Expand All @@ -116,8 +114,6 @@
(make-commit)
(publish-npm)
(github-release)
(binding [*env* {"DATASCRIPT_CLASSIFIER" "-aot1.9"}]
(sh "lein" "with-profile" "+aot,+1.9" "deploy" "clojars"))
(sh "lein" "deploy" "clojars")
(System/exit 0))

Expand Down

0 comments on commit 82487ee

Please sign in to comment.