Skip to content

Commit

Permalink
Improve versioning in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaaad committed Nov 5, 2020
1 parent 5cc5d9d commit 614f4cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/version.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
(recur tags parent (zip/right child)))
(zip/append-child parent replace-node))))))

(defn -main [& version]
(defn -main [version hash]
(with-open [reader (io/reader "pom.xml")]
(let [xml (-> reader
(xml/parse :skip-whitespace true)
(xml-update [::pom/version] (xml/sexp-as-element [::pom/version version]))
(xml-update [::pom/scm ::pom/tag] (xml/sexp-as-element [::pom/tag version])))]
(xml-update [::pom/scm ::pom/tag] (xml/sexp-as-element [::pom/tag hash])))]
(with-open [writer (io/writer "pom.xml")]
(xml/indent xml writer)))))
4 changes: 2 additions & 2 deletions release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ if (!((invoke git rev-parse --abbrev-ref HEAD) -eq "master")) {
}
$version = "1.0.$(invoke git rev-list HEAD --count)"

clj -A:build -m version $version
clj -A:build -M -m version $version $(invoke git rev-parse HEAD)
clj -Spom
invoke git commit -am "Release $version"
invoke git tag $version
invoke git push
invoke git push origin $version
clj -A:depstar "$version.jar"
clj -A:build -m deploy "$version.jar" (Read-Host -Prompt "Username") (Read-Host -Prompt "Token" -AsSecureString | ConvertFrom-SecureString -AsPlainText)
clj -A:build -M -m deploy "$version.jar" (Read-Host -Prompt "Username") (Read-Host -Prompt "Token" -AsSecureString | ConvertFrom-SecureString -AsPlainText)
rm "$version.jar"


0 comments on commit 614f4cb

Please sign in to comment.