Skip to content

Commit

Permalink
ci changed to webly
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Apr 12, 2024
1 parent 24f7f47 commit 44f2d46
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 396 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ jobs:
- name: copy-res
run: ./script/copy_res.sh
shell: bash
- name: show git tag
run: clojure -M:garamond
#- name: clj-kondo
# run: clojure -M:lint
- name: test-clj
run: clojure -M:test
#- name: cloverage
# run: clojure -M:cloverage
- name: Release
if: success()
# if: github.event_name == 'push'
Expand All @@ -54,12 +48,5 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "CI/CD"
rm src/goldly_bindings_generated.cljs
clojure -M:release --patch
git push --tags
# clojure -M:release tag --minor
# clojure -M:release pom
# clojure -M:release jar
# clojure -M:release deploy
# lein release
# bash <(curl -s https://codecov.io/bash)
clojure -T:build jar
clojure -T:build deploy
22 changes: 0 additions & 22 deletions .github/workflows/pr.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
## Demo

```
clojure -X:docs
clj -X:webly:npm-install
clj -X:webly:compile
```

Navigate your webbrowser to port 8080.
Expand Down
51 changes: 51 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
(ns build
(:require
[babashka.fs :as fs]
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))

(def lib 'org.pinkgorilla/ui-leaflet)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))

(defn clean [_]
(b/delete {:path "target"}))

(def pom-template
[[:licenses
[:license
[:name "Eclipse Public License"]
[:url "https://www.eclipse.org/legal/epl-v10.html"]]]
[:developers
[:developer
[:name "pink-gorilla"]]]
[:scm
[:url "https://github.com/pink-gorilla/ui-leaflet/"]
[:connection "scm:git:git://github.com/pink-gorilla/ui-leaflet.git"]
[:developerConnection "scm:git:ssh://[email protected]/pink-gorilla/ui-leaflet.git"]]])

(def opts {:class-dir class-dir
:lib lib
:version version
:basis basis
:pom-data pom-template
:src-dirs ["src"]})

(defn jar [_]
(b/write-pom opts)
(b/copy-dir {:src-dirs ["src"
"resources"
"target/node_modules"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))

(defn deploy "Deploy the JAR to Clojars." [_]
(println "Deploying to Clojars..")
(dd/deploy {:installer :remote
;:sign-releases? true
:pom-file (b/pom-path (select-keys opts [:lib :class-dir]))
;:artifact "target/tech.ml.dataset.jar"
:artifact (b/resolve-path jar-file)}))
8 changes: 8 additions & 0 deletions demo/demo-config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{:build {:disabled-extensions #{; extensions using sci-configs will not work in webly.
"reagent" "re-frame"
"funcool-promesa"
"applied-science.js-interop"
; webly2 is now in webly. needs to be removed from ui-repl.
"webly2"
"ui-repl"
"cljs-ajax"}}}
60 changes: 27 additions & 33 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"target/node_modules" ; css png resources from npm modules
]
:deps
{org.clojure/clojure {:mvn/version "1.10.3"}
org.pinkgorilla/pinkie {:mvn/version "0.3.15"} ; box
}
{org.pinkgorilla/pinkie {:mvn/version "0.5.231"} ; box
org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases
{;https://github.com/applied-science/deps-library
:release
{:extra-deps {applied-science/deps-library {:mvn/version "0.4.0"}}
:main-opts ["-m" "applied-science.deps-library"]}
{; github ci
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.1"}
babashka/fs {:mvn/version "0.0.5"}}
:ns-default build}

; https://github.com/weavejester/cljfmt
:cljfmt
Expand All @@ -25,43 +25,37 @@
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
:main-opts ["-m" "clj-kondo.main" "--lint" "src"]}

:outdated
{:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core"]}

:check
{:extra-deps {athos/clj-check {:git/url "https://github.com/athos/clj-check.git"
:sha "0ca84df1357d71429243b99908303f45a934654c"}}
:main-opts ["-m" "clj-check.check"]}

:garamond
{:main-opts ["-m" "garamond.main"]
:extra-deps {com.workframe/garamond {:mvn/version "0.4.0"}}}

:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "62ef1de18e076903374306060ac0e8a752e57c86"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}

; RUN SERVICES (keep running)
:goldly
{:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.550"}
org.pinkgorilla/ui-repl {:mvn/version "0.0.53"} ; reagent, format, page-nav,...
org.pinkgorilla/ui-input {:mvn/version "0.0.21"} ; select, button
}
:extra-paths ["demo"]
:jvm-opts ["-Dmaven.wagon.rto=90000"]
:exec-fn modular.system/start!
:exec-args {:profile "jetty"
:config ["webly/config.edn" "goldly/config.edn"
"demo/demo-config.edn"]
:services "goldly/services.edn"}}

; BUILD BUNDLE (then exit)
:build
{:exec-fn goldly.app.build/goldly-build
:exec-args {:profile "compile2"}}
; demo ui
:webly {:exec-fn webly.app.app/webly-build
:extra-deps {org.pinkgorilla/webly {:mvn/version "0.5.661"}
org.pinkgorilla/ui-repl {:mvn/version "0.1.94"}}
:extra-paths ["demo" "demo/resources"]
:exec-args {:config ["demo-config.edn"]
:profile "npm-install"}}

:npm-install {:exec-args {:profile "npm-install"}}
:compile {:exec-args {:profile "compile2"}}
:release {:exec-args {:profile "release"}}
:release-adv {:exec-args {:profile "release-adv"}}
:static {:exec-args {:profile "static"}}
:ci {:exec-args {:profile "ci"}}

:run {:exec-fn modular.system/start!
:extra-paths ["demo" "demo/resources"]
:exec-args {:profile "jetty"
:config ["demo-config.edn"]
:services "demo-services.edn"}}

;
}}
Loading

0 comments on commit 44f2d46

Please sign in to comment.