-
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.12 KB
/
release.yml
File metadata and controls
82 lines (68 loc) · 2.12 KB
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
services:
stripe-mock:
image: stripe/stripe-mock:latest
ports:
- 12111:12111
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for changelog
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: latest
- name: Cache deps
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
~/.clojure/.cpcache
key: ${{ runner.os }}-clojure-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-clojure-
- name: Run unit tests
run: clojure -M:test
- name: Run integration tests
run: clojure -M:test-integration
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build JAR
run: clojure -T:build jar :version '"${{ steps.version.outputs.VERSION }}"'
- name: Deploy to Clojars
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: clojure -T:build deploy :version '"${{ steps.version.outputs.VERSION }}"'
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v4
with:
config: .github/cliff.toml
args: --latest --strip header
env:
OUTPUT: CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.content }}
files: target/*.jar
# Automatically marks v1.0.0-beta.1 as a pre-release
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}