Skip to content

dryewo/clojure-library-template

Repository files navigation

clojure-library-template

Build Status Clojars Project

Leiningen template for libraries with better release cycle.

Usage

lein new library com.example/<lib_name>

Among other improvements, the generated library uses an alternative release cycle:

  1. Version in project.clj is the latest released version. It's not decorated with -SNAPSHOT.
  2. When you release it, you decide which version increment you are making and you run lein release <segment>, where <segment> is one of :major, :minor, :patch.
  3. During lein release (after incrementing the version in project.clj) all mentions of the version in README.md are updated to the current one, as well as Unreleased section in CHANGELOG.md is renamed to the current version.

Example:

  • Right now you have version "1.2.3" in your project.clj.
  • That means that version "1.2.3" was released a while ago, and in the repository there are some new changes since that last release.
  • CHANGELOG.md already contains all the descriptions of significant changes that you have made since then in the Unreleased section, because you were updating it regularly.
  • You look at CHANGELOG.md and realize that there's a new feature there and you want to release it now, which means minor version release, from "1.2.3" to "1.3.0".
  • You run lein release :minor, and it does for you:
    • Checks that there are no uncommitted changes.
    • Bumps the version in project.clj from "1.2.3" to "1.3.0".
    • Updates CHANGELOG.md: moves contents from Unreleased section to the new "1.3.0" section.
    • Replaces mentions of "1.2.3" in README.md with "1.3.0".
    • Commits the changes.
    • Creates a tag "1.3.0".
    • Uploads the JAR to Clojars.
    • Does git push.

License

Copyright © 2018 Dmitrii Balakhonskii

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.