-
-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (41 loc) · 1.09 KB
/
build-deploy.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
name: Build and deploy
on:
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths:
- 'src/**'
- 'test/**'
- project.clj
- deps.edn
jobs:
build:
runs-on: ubuntu-22.04
env:
CLOJARS_TOKEN: ${{ secrets.CLOJARS_DEPLOY_TOKEN }}
steps:
- uses: actions/checkout@v3
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "JAVA8_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@10.0
with:
cli: 1.11.1.1200
- run: ./script/test.sh
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Set version
run: |
sed -i 's/"0.0.0"/"${{ github.ref_name }}"/g' project.clj
- run: lein jar
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Deploy to Clojars
run: |
lein deploy clojars
- uses: actions/upload-artifact@v3
with:
name: jar
path: 'target/*.jar'