Skip to content

Commit

Permalink
Set up automagic deploy (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
slipset authored Oct 8, 2021
1 parent c6612e4 commit 5c5d322
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 10 deletions.
107 changes: 100 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
version: 2.1

workflows:
version: 2
default:
jobs:
- reflection:
filters:
tags:
only: /.*/

- openjdk-8:
filters:
tags:
only: /.*/

- openjdk-11:
filters:
tags:
only: /.*/

- deploy:
requires: [openjdk-8, openjdk-11, reflection]
filters:
tags:
only: /Release-.*/
context:
- CLOJARS_DEPLOY

commands:
setup-project:
description: "Setup project"
Expand Down Expand Up @@ -79,10 +107,75 @@ jobs:
- setup-project
- run-tests

workflows:
version: 2
default:
jobs:
- reflection
- openjdk-8
- openjdk-11
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
8 changes: 5 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
(defproject org.flatland/ordered "1.5.10-SNAPSHOT"
(defproject org.flatland/ordered (or (System/getenv "PROJECT_VERSION") "1.5.10")
:url "https://github.com/clj-commons/ordered"
:license {:name "Eclipse Public License - v 1.0"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:description "Pure-clojure implementation of ruby's ordered hash and set types - instead of sorting by key, these collections retain insertion order."
:dependencies [[org.clojure/clojure "1.10.1"]]
:aliases {"testall" ["with-profile" "+1.8:+1.9:+1.10.0:+1.10.1" "test"]
"depsall" ["with-profile" "+1.8:+1.9:+1.10.0:+1.10.1" "deps"]}
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:deploy-repositories [["clojars" {:url "https://repo.clojars.org"
:username :env/clojars_username
:password :env/clojars_ordered_password
:sign-releases true}]]
:profiles {:1.10.1 {:dependencies [[org.clojure/clojure "1.10.1"]]}
:1.10.0 {:dependencies [[org.clojure/clojure "1.10.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
Expand Down

0 comments on commit 5c5d322

Please sign in to comment.