Tweak release script

This commit is contained in:
Michiel Borkent 2022-05-09 17:01:54 +02:00
parent 73306079ec
commit 6960bc5d24

View file

@ -7,12 +7,14 @@
(or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
(System/getenv "APPVEYOR_REPO_BRANCH")
(System/getenv "CIRCLE_BRANCH")
(System/getenv "GITHUB_REF_NAME")
(-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD")
:out
str/trim)))
(defn release [& args]
(let [ght (System/getenv "GITHUB_TOKEN")
_ (println "Github token found")
file (first args)
branch (current-branch)
current-version
@ -20,6 +22,7 @@
str/trim)]
(if (and ght (contains? #{"master" "main"} branch))
(do (assert file "File name must be provided")
(println "On main branch. Publishing asset.")
(ghr/overwrite-asset {:org "babashka"
:repo "babashka"
:file file