Skip to content

Commit

Permalink
Setup project for clj-commons
Browse files Browse the repository at this point in the history
  • Loading branch information
slipset authored Oct 11, 2021
1 parent 40bf400 commit a66741e
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 25 deletions.
135 changes: 135 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
# For a detailed guide to building and testing with clojure, read the docs:
# https://circleci.com/docs/2.0/language-clojure/ for more details
version: 2.1

workflows:
build-deploy:
jobs:
- build:
filters:
tags:
only: /.*/

- deploy:
requires:
- build
filters:
tags:
only: /Release-.*/
context:
- CLOJARS_DEPLOY

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
# specify the version you desire here
- image: circleci/clojure:lein-2.9.5

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo

environment:
LEIN_ROOT: "true"
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m

# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: lein deps

- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "project.clj" }}

# run tests!
- run: lein test

deploy:
docker:
# specify the version you desire here
- image: circleci/clojure:openjdk-8-lein-2.9.1
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo

environment:
LEIN_ROOT: "true"
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: Install babashka
command: |
curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install -o install.sh
sudo bash install.sh
rm install.sh
- run:
name: Install deployment-script
command: |
curl -s https://raw.githubusercontent.com/clj-commons/infra/main/deployment/circle-maybe-deploy.bb -o circle-maybe-deploy.bb
chmod a+x circle-maybe-deploy.bb
- run: lein deps

- run:
name: Setup GPG signing key
command: |
GNUPGHOME="$HOME/.gnupg"
export GNUPGHOME
mkdir -p "$GNUPGHOME"
chmod 0700 "$GNUPGHOME"
echo "$GPG_KEY" \
| base64 --decode --ignore-garbage \
| gpg --batch --allow-secret-key-import --import
gpg --keyid-format LONG --list-secret-keys
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "project.clj" }}
- run:
name: Deploy
command: |
GPG_TTY=$(tty)
export GPG_TTY
echo $GPG_TTY
./circle-maybe-deploy.bb lein deploy clojars
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @borkdude @slipset
22 changes: 0 additions & 22 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# digest

![Build Status](https://github.com/tebeka/clj-digest/workflows/Test/badge.svg)
[![Clojars Project](https://img.shields.io/clojars/v/org.clj-commons/clj-digest.svg)](https://clojars.org/org.clj-commons/clj-digest)
[![cljdoc badge](https://cljdoc.org/badge/org.clj-commons/clj-digest)](https://cljdoc.org/d/org.clj-commons/clj-digest)
[![CircleCI Status](https://circleci.com/gh/clj-commons/clj-digest.svg?style=svg)](https://circleci.com/gh/clj-commons/clj-digest)

`digest` - Message digest library for Clojure. Providing md5, sha-256, ...

Expand Down
8 changes: 6 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
(defproject digest "1.4.10"
(defproject org.clj-commons/digest (or (System/getenv "PROJECT_VERSION") "1.4.10")
:description "Digest algorithms (MD5, SHA ...) for Clojure"
:author "Miki Tebeka <[email protected]>"
:url "https://github.com/tebeka/clj-digest"
:url "https://github.com/clj-commons/clj-digest"
:deploy-repositories [["clojars" {:url "https://repo.clojars.org"
:username :env/clojars_username
:password :env/clojars_password
:sign-releases true}]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]])

0 comments on commit a66741e

Please sign in to comment.