-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (60 loc) · 1.76 KB
/
build.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
name: build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.11.1'
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: cljdeps-${{ hashFiles('project.clj') }}
restore-keys: cljdeps-
- name: Run tests
run: lein with-profile +1.9:+1.10:+1.11 test
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
echo "version=$(head -n 1 project.clj | sed -e 's/^(defproject.*\"\(.*\)\"$/\1/')" \
>> "$GITHUB_OUTPUT"
deploy:
if: ${{ github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
endsWith(needs.get-version.outputs.version, '-SNAPSHOT') }}
needs: [test, get-version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.11.1'
- name: Deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: lein deploy snapshots