|
1 | 1 | version: 2.1
|
| 2 | + |
| 3 | +workflows: |
| 4 | + version: 2 |
| 5 | + default: |
| 6 | + jobs: |
| 7 | + - reflection: |
| 8 | + filters: |
| 9 | + tags: |
| 10 | + only: /.*/ |
| 11 | + |
| 12 | + - openjdk-8: |
| 13 | + filters: |
| 14 | + tags: |
| 15 | + only: /.*/ |
| 16 | + |
| 17 | + - openjdk-11: |
| 18 | + filters: |
| 19 | + tags: |
| 20 | + only: /.*/ |
| 21 | + |
| 22 | + - deploy: |
| 23 | + requires: [openjdk-8, openjdk-11, reflection] |
| 24 | + filters: |
| 25 | + tags: |
| 26 | + only: /Release-.*/ |
| 27 | + context: |
| 28 | + - CLOJARS_DEPLOY |
| 29 | + |
2 | 30 | commands:
|
3 | 31 | setup-project:
|
4 | 32 | description: "Setup project"
|
@@ -79,10 +107,75 @@ jobs:
|
79 | 107 | - setup-project
|
80 | 108 | - run-tests
|
81 | 109 |
|
82 |
| -workflows: |
83 |
| - version: 2 |
84 |
| - default: |
85 |
| - jobs: |
86 |
| - - reflection |
87 |
| - - openjdk-8 |
88 |
| - - openjdk-11 |
| 110 | + deploy: |
| 111 | + docker: |
| 112 | + # specify the version you desire here |
| 113 | + - image: circleci/clojure:openjdk-8-lein-2.9.1 |
| 114 | + # Specify service dependencies here if necessary |
| 115 | + # CircleCI maintains a library of pre-built images |
| 116 | + # documented at https://circleci.com/docs/2.0/circleci-images/ |
| 117 | + # - image: circleci/postgres:9.4 |
| 118 | + |
| 119 | + working_directory: ~/repo |
| 120 | + |
| 121 | + environment: |
| 122 | + LEIN_ROOT: "true" |
| 123 | + # Customize the JVM maximum heap limit |
| 124 | + JVM_OPTS: -Xmx3200m |
| 125 | + |
| 126 | + steps: |
| 127 | + - checkout |
| 128 | + |
| 129 | + # Download and cache dependencies |
| 130 | + - restore_cache: |
| 131 | + keys: |
| 132 | + - v1-dependencies-{{ checksum "project.clj" }} |
| 133 | + # fallback to using the latest cache if no exact match is found |
| 134 | + - v1-dependencies- |
| 135 | + |
| 136 | + # Download and cache dependencies |
| 137 | + - restore_cache: |
| 138 | + keys: |
| 139 | + - v1-dependencies-{{ checksum "project.clj" }} |
| 140 | + # fallback to using the latest cache if no exact match is found |
| 141 | + - v1-dependencies- |
| 142 | + |
| 143 | + - run: |
| 144 | + name: Install babashka |
| 145 | + command: | |
| 146 | + curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install -o install.sh |
| 147 | + sudo bash install.sh |
| 148 | + rm install.sh |
| 149 | + - run: |
| 150 | + name: Install deployment-script |
| 151 | + command: | |
| 152 | + curl -s https://raw.githubusercontent.com/clj-commons/infra/main/deployment/circle-maybe-deploy.bb -o circle-maybe-deploy.bb |
| 153 | + chmod a+x circle-maybe-deploy.bb |
| 154 | +
|
| 155 | + - run: lein deps |
| 156 | + |
| 157 | + - run: |
| 158 | + name: Setup GPG signing key |
| 159 | + command: | |
| 160 | + GNUPGHOME="$HOME/.gnupg" |
| 161 | + export GNUPGHOME |
| 162 | + mkdir -p "$GNUPGHOME" |
| 163 | + chmod 0700 "$GNUPGHOME" |
| 164 | +
|
| 165 | + echo "$GPG_KEY" \ |
| 166 | + | base64 --decode --ignore-garbage \ |
| 167 | + | gpg --batch --allow-secret-key-import --import |
| 168 | +
|
| 169 | + gpg --keyid-format LONG --list-secret-keys |
| 170 | +
|
| 171 | + - save_cache: |
| 172 | + paths: |
| 173 | + - ~/.m2 |
| 174 | + key: v1-dependencies-{{ checksum "project.clj" }} |
| 175 | + - run: |
| 176 | + name: Deploy |
| 177 | + command: | |
| 178 | + GPG_TTY=$(tty) |
| 179 | + export GPG_TTY |
| 180 | + echo $GPG_TTY |
| 181 | + ./circle-maybe-deploy.bb lein deploy clojars |
0 commit comments