Tweak release script
This commit is contained in:
parent
73306079ec
commit
6960bc5d24
1 changed files with 3 additions and 0 deletions
|
|
@ -7,12 +7,14 @@
|
||||||
(or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
|
(or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
|
||||||
(System/getenv "APPVEYOR_REPO_BRANCH")
|
(System/getenv "APPVEYOR_REPO_BRANCH")
|
||||||
(System/getenv "CIRCLE_BRANCH")
|
(System/getenv "CIRCLE_BRANCH")
|
||||||
|
(System/getenv "GITHUB_REF_NAME")
|
||||||
(-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD")
|
(-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD")
|
||||||
:out
|
:out
|
||||||
str/trim)))
|
str/trim)))
|
||||||
|
|
||||||
(defn release [& args]
|
(defn release [& args]
|
||||||
(let [ght (System/getenv "GITHUB_TOKEN")
|
(let [ght (System/getenv "GITHUB_TOKEN")
|
||||||
|
_ (println "Github token found")
|
||||||
file (first args)
|
file (first args)
|
||||||
branch (current-branch)
|
branch (current-branch)
|
||||||
current-version
|
current-version
|
||||||
|
|
@ -20,6 +22,7 @@
|
||||||
str/trim)]
|
str/trim)]
|
||||||
(if (and ght (contains? #{"master" "main"} branch))
|
(if (and ght (contains? #{"master" "main"} branch))
|
||||||
(do (assert file "File name must be provided")
|
(do (assert file "File name must be provided")
|
||||||
|
(println "On main branch. Publishing asset.")
|
||||||
(ghr/overwrite-asset {:org "babashka"
|
(ghr/overwrite-asset {:org "babashka"
|
||||||
:repo "babashka"
|
:repo "babashka"
|
||||||
:file file
|
:file file
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue