forked from metosin/ring-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (77 loc) · 2.34 KB
/
clojure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: Run tests
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
ACTIONS_CACHE_VERSION: 0
jobs:
test:
strategy:
matrix:
jdk: [8, 11, 17, 20]
name: Java ${{ matrix.jdk }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java ${{ matrix.jdk }}
uses: actions/[email protected]
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- name: Maven Cache
id: maven-cache
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
key: m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-${{ matrix.jdk }}
restore-keys: |
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
lein: latest
- name: Run tests
run: lein do clean, all midje, all check
deploy:
concurrency: deploy
needs: test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Prepare java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: deploy
env:
CLOJARS_USER: 'threatgrid-clojars'
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Threatgrid"
if [[ "$COMMIT_MSG" == "Release :major" ]]; then
lein release :major
elif [[ "$COMMIT_MSG" == "Release :minor" ]]; then
lein release :minor
elif [[ "$COMMIT_MSG" == "Release :patch" ]]; then
lein release :patch
else
lein deploy snapshot
fi