1
- # Use the latest 2.1 version of CircleCI pipeline process engine.
2
- # See: https://circleci.com/docs/2.0/configuration-reference
3
- # For a detailed guide to building and testing with clojure, read the docs:
4
- # https://circleci.com/docs/2.0/language-clojure/ for more details
5
1
version : 2.1
6
2
7
- # Define a job to be invoked later in a workflow.
8
- # See: https://circleci.com/docs/2.0/configuration-reference/#jobs
3
+ workflows :
4
+ build-deploy :
5
+ jobs :
6
+ - build :
7
+ filters :
8
+ tags :
9
+ only : /.*/
10
+
11
+ - deploy :
12
+ requires :
13
+ - build
14
+ filters :
15
+ tags :
16
+ only : /Release-.*/
17
+ context :
18
+ - CLOJARS_DEPLOY
19
+
9
20
jobs :
10
21
build :
11
- # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
12
- # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
13
22
docker :
14
23
# specify the version you desire here
15
24
- image : clojure:openjdk-8-lein-2.9.8-bullseye
26
35
# Customize the JVM maximum heap limit
27
36
JVM_OPTS : -Xmx3200m
28
37
29
- # Add steps to the job
30
- # See: https://circleci.com/docs/2.0/configuration-reference/#steps
31
38
steps :
32
39
- checkout
33
40
@@ -45,13 +52,82 @@ jobs:
45
52
- ~/.m2
46
53
key : v1-dependencies-{{ checksum "project.clj" }}
47
54
55
+ - run :
56
+ name : Ensure No Reflection Warnings
57
+ command : " ! lein check 2>&1 | grep 'Reflection warning'"
58
+
48
59
# run tests!
49
- - run : lein test
60
+ - run : lein do clean, test
50
61
51
- # Invoke jobs via workflows
52
- # See: https://circleci.com/docs/2.0/configuration-reference/#workflows
53
- workflows :
54
- sample : # This is the name of the workflow, feel free to change it to better match your workflow.
55
- # Inside the workflow, you define the jobs you want to run.
56
- jobs :
57
- - build
62
+ deploy :
63
+ docker :
64
+ # specify the version you desire here
65
+ - image : clojure:openjdk-8-lein-2.9.8-bullseye
66
+ # Specify service dependencies here if necessary
67
+ # CircleCI maintains a library of pre-built images
68
+ # documented at https://circleci.com/docs/2.0/circleci-images/
69
+ # - image: circleci/postgres:9.4
70
+
71
+ working_directory : ~/repo
72
+
73
+ environment :
74
+ LEIN_ROOT : " true"
75
+ # Customize the JVM maximum heap limit
76
+ JVM_OPTS : -Xmx3200m
77
+
78
+ steps :
79
+ - checkout
80
+
81
+ # Download and cache dependencies
82
+ - restore_cache :
83
+ keys :
84
+ - v1-dependencies-{{ checksum "project.clj" }}
85
+ # fallback to using the latest cache if no exact match is found
86
+ - v1-dependencies-
87
+
88
+ # Download and cache dependencies
89
+ - restore_cache :
90
+ keys :
91
+ - v1-dependencies-{{ checksum "project.clj" }}
92
+ # fallback to using the latest cache if no exact match is found
93
+ - v1-dependencies-
94
+
95
+ - run :
96
+ name : Install babashka
97
+ command : |
98
+ curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install -o install.sh
99
+ sudo bash install.sh
100
+ rm install.sh
101
+ - run :
102
+ name : Install deployment-script
103
+ command : |
104
+ curl -s https://raw.githubusercontent.com/clj-commons/infra/main/deployment/circle-maybe-deploy.bb -o circle-maybe-deploy.bb
105
+ chmod a+x circle-maybe-deploy.bb
106
+
107
+ - run : lein deps
108
+
109
+ - run :
110
+ name : Setup GPG signing key
111
+ command : |
112
+ GNUPGHOME="$HOME/.gnupg"
113
+ export GNUPGHOME
114
+ mkdir -p "$GNUPGHOME"
115
+ chmod 0700 "$GNUPGHOME"
116
+
117
+ echo "$GPG_KEY" \
118
+ | base64 --decode --ignore-garbage \
119
+ | gpg --batch --allow-secret-key-import --import
120
+
121
+ gpg --keyid-format LONG --list-secret-keys
122
+
123
+ - save_cache :
124
+ paths :
125
+ - ~/.m2
126
+ key : v1-dependencies-{{ checksum "project.clj" }}
127
+ - run :
128
+ name : Deploy
129
+ command : |
130
+ GPG_TTY=$(tty)
131
+ export GPG_TTY
132
+ echo $GPG_TTY
133
+ ./circle-maybe-deploy.bb lein deploy clojars
0 commit comments