diff --git a/README.md b/README.md index 13b05e0d..bc4e2870 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,26 @@ lein doc - Tutorials: - [Modeling Threat Intelligence in CTIM](doc/tutorials/modeling-threat-intel-ctim.md) +## Releases + +```clojure +# snapshot release +lein deploy + +# for releases, set project.clj version to x.y.z-SNAPSHOT +# this command then releases as x.y.z and bumps to x.y.(z+1)-SNAPSHOT +# aliased as ./script/release.sh +lein release :patch + +# if release fails partway through, use these commands to recover +git tag --delete x.y.z +# you might have a redundant commit "Version x.y.z", undo with: +git reset --hard SHA_BEFORE_FAILED_RELEASE +``` + ## License -Copyright © 2016-2023 Cisco Systems +Copyright © 2016-2024 Cisco Systems Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version. diff --git a/project.clj b/project.clj index a478e73d..709d4737 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject threatgrid/ctim "1.3.21-SNAPSHOT" +(defproject threatgrid/ctim "1.3.22-SNAPSHOT" :description "Cisco Threat Intelligence Model" :url "http://github.com/threatgrid/ctim" :license {:name "Eclipse Public License" @@ -24,13 +24,30 @@ :plugins [[lein-cljsbuild "1.1.7"] [com.google.guava/guava "20.0"] ;resolve internal conflict in `lein-doo` [lein-doo "0.1.11" :exclusions [org.clojure/clojure]] + ;;uncomment for lein-git-down #_[reifyhealth/lein-git-down "0.3.5"]] + ;;uncomment for lein-git-down ;:middleware [lein-git-down.plugin/inject-properties] ;:repositories [["public-github" {:url "git://github.com"}] ; ["private-github" {:url "git://github.com" :protocol :ssh}]] - + :release-tasks [["clean"] + ["doc"] + ;; this command will fail if `lein doc` generates anything new + ;; please commit it and try again + ["vcs" "assert-committed"] + ["change" "version" "leiningen.release/bump-version" "release"] + ;; will fail if project.clj doesn't already have -SNAPSHOT version + ["vcs" "commit"] + ["vcs" "tag" "--no-sign"] + ["deploy" "clojars"] + ["change" "version" "leiningen.release/bump-version"] + ["vcs" "commit"] + ;; fails if no upstream branch is defined + ;; if it fails at this point you can complete the release using: + ;; git push --tags --set-upstream origin release-x.y.z + ["vcs" "push"]] :aliases {"doc" ^{:doc "Generate documentation"} ["run" "-m" "ctim.document"] "docs" ^{:doc "Generate documentation"} ["doc"] diff --git a/script/release.sh b/script/release.sh new file mode 100755 index 00000000..a1c085b5 --- /dev/null +++ b/script/release.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -xe +lein release :patch