Skip to content

Add automated build/deploy on CI #33

@lread

Description

@lread

Proposal

For consistent builds/releases automate the process on CI

Benefits

  • Building on a clean CI server reduces risks of any maliciousness sneaking into a jar (not a big worry for Clojure libs, but still)
  • Ensures a consistent release, for examples:
    • scm info in pom.xml will be correct for clojars and cljdoc
    • can add checks, for example, does changelog have any description of release?
  • Avoids human error

Mechanics

I like the slipset strategy which I think borkdude has also adopted.

Here's how it works for graal-build-time:

A new release is cut via a publish task which runs the following locally:

  • verifies change log looks good
  • bumps the version (which is stored in its own file)
  • applies version to change log (we could update README here too if appropriate)
  • git commits
  • git tags
  • git pushes

On CI, for each commit a deploy task is run which

  • builds the lib jar
  • attempts to deploys the lib jar to clojars

At first, this seemed rather unrefined to me, as we are attempting a deploy to clojars when we have no intention of really doing so, but this will fail by design when clojars already has version x of our lib.

I love the simplicity of this approach, but still might not be able to avoid the temptation of refining slightly to not attempt a deploy when clojars already has version x of our lib.

Alternatives

For my projects, I initiate a release via a button on a GitHub Actions release flow.
I think the slipset/borkdude strategy is maybe simpler (maybe mine is easier?).

Implementation Details

I seem to be using GitHub Actions these days more than CircleCI, but would defer to your preference.

This change would include moving from the deprecated depstar to clojure tools build.

I'd also bring in babashka for build tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions