Skip to content

Commit 5cdeb5f

Browse files
authored
Automate publishing of release (#69)
Invoked via `bb publish` Read doc/03-maintainer-guide.adoc for details Details of interest: - using neil convention of storing version in deps.edn - tagging with v1.2.3 instead of Release-1.2.3 - now at version 1.x (was 0.x) - version patch is now release count, was commit count, next version should be 1.0.13 - hiredman - 4 releases - martinklepsch - 4 releases - clj-commons - 4 releases - addition of anemic pom includes artifact description which gets displayed by services like clojars and cljdoc Closes #65
1 parent e9210b7 commit 5cdeb5f

21 files changed

+681
-337
lines changed

.github/workflows/ci.yml

-190
This file was deleted.

.github/workflows/publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: publish
2+
on:
3+
push:
4+
tags:
5+
- 'v\d+.*'
6+
7+
jobs:
8+
test:
9+
uses: ./.github/workflows/tests.yml
10+
11+
publish:
12+
environment: publish
13+
runs-on: ubuntu-latest
14+
needs: [test]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup
21+
uses: ./.github/workflows/shared-setup
22+
with:
23+
jdk: '8'
24+
25+
- name: Deploy to clojars
26+
env:
27+
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
28+
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
29+
run: bb -ci-clojars-deploy
30+
31+
- name: Create GitHub Release
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: bb -ci-github-create-release
35+
36+
- name: Inform Cljdoc
37+
run: bb -ci-cljdoc-request-build
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'shared setup'
2+
inputs:
3+
jdk:
4+
description: 'jdk version'
5+
required: true
6+
shell:
7+
# shell must be specified for run:s for composite actions
8+
description: 'which shell to use'
9+
required: false
10+
default: bash
11+
12+
runs:
13+
using: 'composite'
14+
15+
steps:
16+
- name: Clojure deps cache
17+
uses: actions/cache@v3
18+
with:
19+
path: |
20+
~/.m2/repository
21+
~/.deps.clj
22+
~/.gitlibs
23+
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
24+
restore-keys: cljdeps-
25+
26+
- name: Setup Java
27+
uses: actions/setup-java@v3
28+
with:
29+
distribution: 'temurin'
30+
java-version: ${{ inputs.jdk }}
31+
32+
- name: Install Clojure Tools
33+
uses: DeLaGuardo/[email protected]
34+
with:
35+
cli: 'latest'
36+
bb: 'latest'
37+
38+
- name: Tools Versions
39+
shell: ${{ inputs.shell }}
40+
run: |
41+
echo "java -version"
42+
java -version
43+
echo "bb --version"
44+
bb --version
45+
echo "clojure --version"
46+
clojure --version
47+
- name: Download Clojure Dependencies
48+
shell: ${{ inputs.shell }}
49+
run: bb download-deps

.github/workflows/tests.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: tests
2+
on:
3+
# allow this workflow to be called from other workflows, namely: publish
4+
workflow_call:
5+
push:
6+
branches: [ "master" ]
7+
pull_request:
8+
branches: [ "master" ]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/[email protected]
17+
18+
- name: Setup
19+
uses: ./.github/workflows/shared-setup
20+
with:
21+
jdk: '11'
22+
23+
- name: Lint
24+
run: bb lint
25+
26+
test-jvm:
27+
runs-on: ${{ matrix.os.name }}-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [{name: 'windows', shell: 'pwsh'}, {name: 'ubuntu', shell: 'bash'}]
32+
clojure-version: ["1.8", "1.9", "1.10", "1.11"]
33+
jdk: ['8', '11', '17']
34+
35+
name: ${{ matrix.os.name }} clj-${{ matrix.clojure-version }} jdk${{ matrix.java-version }}
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
41+
- name: Setup
42+
uses: ./.github/workflows/shared-setup
43+
with:
44+
jdk: ${{ matrix.jdk }}
45+
shell: ${{ matrix.os.shell }}
46+
47+
- name: Run tests
48+
run: bb test:jvm --clj-version ${{ matrix.clojure-version }}
49+
50+
test-bb:
51+
runs-on: ${{ matrix.os.name }}-latest
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
os: [{name: 'windows', shell: 'pwsh'}, {name: 'ubuntu', shell: 'bash'}]
56+
57+
name: ${{ matrix.os.name }} bb
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/[email protected]
62+
63+
- name: Setup
64+
uses: ./.github/workflows/shared-setup
65+
with:
66+
jdk: '11'
67+
shell: ${{ matrix.os.shell }}
68+
69+
- name: Run tests
70+
run: bb test:bb

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
build
21
target
32
lib
43
*.dot
@@ -7,7 +6,6 @@ lib
76
syntax: glob
87
creds.clj
98
Manifest.txt
10-
pom.xml
119
aws.clj
1210
*.ser
1311
*.class

0 commit comments

Comments
 (0)