File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 22 :deps {borkdude/gh-release-artifact {:git/url " https://github.com/borkdude/gh-release-artifact"
33 :git/sha " 4a9a74f0e50e897c45df8cc70684360eb30fce80" }}
44 :min-bb-version " 0.8.156"
5- :tasks {debug-cli make/debug-cli
5+ :tasks {tag make/tag
6+ debug-cli make/debug-cli
67 prod-jar make/prod-jar
78 native-cli make/native-cli}}
Original file line number Diff line number Diff line change 22 (:require
33 [babashka.deps :as deps]
44 [babashka.fs :as fs]
5- [babashka.process :as p]))
5+ [babashka.process :as p]
6+ [babashka.tasks :refer [shell]]
7+ [clojure.string :as string]))
68
79(def windows? (#'fs/windows? ))
810
11+ (defn ^:private replace-in-file [file regex content]
12+ (as-> (slurp file) $
13+ (string/replace $ regex content)
14+ (spit file $)))
15+
16+ (defn ^:private add-changelog-entry [tag comment]
17+ (replace-in-file " CHANGELOG.md"
18+ #"## Unreleased"
19+ (if comment
20+ (format " ## Unreleased\n\n ## %s\n\n - %s" tag comment)
21+ (format " ## Unreleased\n\n ## %s" tag))))
22+
923(defn ^:private mv-here [file]
1024 (fs/move file " ." {:replace-existing true }))
1125
3751 []
3852 (build " native-cli" )
3953 (mv-here (fs/path (eca-bin-filename :native ))))
54+
55+ (defn tag [& [tag]]
56+ (shell " git fetch origin" )
57+ (shell " git pull origin HEAD" )
58+ (spit " resources/ECA_VERSION" tag)
59+ (add-changelog-entry tag nil )
60+ (prod-jar )
61+ (shell " git add resources/ECA_VERSION CHANGELOG.md" )
62+ (shell (format " git commit -m \" Release: %s\" " tag))
63+ (shell (str " git tag " tag))
64+ (shell " git push origin HEAD" )
65+ (shell " git push origin --tags" ))
You can’t perform that action at this time.
0 commit comments