Skip to content

Commit 76e2aad

Browse files
committed
add action
1 parent 2ff20f1 commit 76e2aad

File tree

3 files changed

+108
-10
lines changed

3 files changed

+108
-10
lines changed

.github/workflows/build.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
name: Run tests
3+
4+
on:
5+
push:
6+
branches: [master, "1.1.x"]
7+
pull_request:
8+
branches: [master, "1.1.x"]
9+
10+
env:
11+
ACTIONS_CACHE_VERSION: 0
12+
13+
jobs:
14+
test:
15+
strategy:
16+
matrix:
17+
jdk: [8, 11, 17, 21]
18+
19+
name: Java ${{ matrix.jdk }}
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Setup Java ${{ matrix.jdk }}
26+
uses: actions/[email protected]
27+
with:
28+
distribution: temurin
29+
java-version: ${{ matrix.jdk }}
30+
- name: Maven Cache
31+
id: maven-cache
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.m2/repository
36+
~/.gitlibs
37+
key: m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-${{ matrix.jdk }}
38+
restore-keys: |
39+
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-
40+
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-
41+
- name: Setup Clojure
42+
uses: DeLaGuardo/setup-clojure@master
43+
with:
44+
lein: latest
45+
- name: Run tests
46+
run: lein do clean, all midje, all check
47+
deploy:
48+
concurrency: deploy
49+
needs: test
50+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v2
55+
- name: Maven Cache
56+
id: maven-cache
57+
uses: actions/cache@v3
58+
with:
59+
path: |
60+
~/.m2/repository
61+
~/.gitlibs
62+
key: m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-${{ matrix.jdk }}
63+
restore-keys: |
64+
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-
65+
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-
66+
- name: Prepare java
67+
uses: actions/setup-java@v2
68+
with:
69+
distribution: 'adopt'
70+
java-version: '11'
71+
- name: deploy
72+
env:
73+
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
74+
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
75+
COMMIT_MSG: ${{ github.event.head_commit.message }}
76+
run: |
77+
if [[ "$COMMIT_MSG" == "Release :major" ]]; then
78+
lein release :major
79+
elif [[ "$COMMIT_MSG" == "Release :minor" ]]; then
80+
lein release :minor
81+
elif [[ "$COMMIT_MSG" == "Release :patch" ]]; then
82+
lein release :patch
83+
elif [[ "$COMMIT_MSG" == "Release :alpha" ]]; then
84+
lein release :alpha
85+
elif [[ "$COMMIT_MSG" == "Release :beta" ]]; then
86+
lein release :beta
87+
elif [[ "$COMMIT_MSG" == "Release :rc" ]]; then
88+
lein release :rc
89+
else
90+
lein deploy snapshot
91+
fi

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

project.clj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,23 @@
5656
:target "gh-pages/doc"
5757
:src-uri "http://github.com/metosin/compojure-api/blob/master/"
5858
:src-uri-prefix "#L"}
59-
:deploy-repositories [["releases" :clojars]]
59+
:deploy-repositories [["snapshot" {:url "https://clojars.org/repo"
60+
:username [:gpg :env/clojars_user]
61+
:password [:gpg :env/clojars_token]
62+
:sign-releases false}]
63+
["releases" {:url "https://clojars.org/repo"
64+
:username [:gpg :env/clojars_user]
65+
:password [:gpg :env/clojars_token]
66+
:sign-releases false}]]
67+
:release-tasks [["clean"]
68+
["vcs" "assert-committed"]
69+
["change" "version" "leiningen.release/bump-version" "release"]
70+
["vcs" "commit"]
71+
["vcs" "tag" "--no-sign"]
72+
["deploy" "release"]
73+
["change" "version" "leiningen.release/bump-version"]
74+
["vcs" "commit"]
75+
["vcs" "push"]]
6076
:aliases {"all" ["with-profile" "dev:dev,logging:dev,1.10"]
6177
"start-thingie" ["run"]
6278
"aot-uberjar" ["with-profile" "uberjar" "do" "clean," "ring" "uberjar"]

0 commit comments

Comments
 (0)