Skip to content

Commit

Permalink
Automate publishing of release (#69)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lread authored Sep 29, 2022
1 parent e9210b7 commit 5cdeb5f
Show file tree
Hide file tree
Showing 21 changed files with 681 additions and 337 deletions.
190 changes: 0 additions & 190 deletions .github/workflows/ci.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: publish
on:
push:
tags:
- 'v\d+.*'

jobs:
test:
uses: ./.github/workflows/tests.yml

publish:
environment: publish
runs-on: ubuntu-latest
needs: [test]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/workflows/shared-setup
with:
jdk: '8'

- name: Deploy to clojars
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: bb -ci-clojars-deploy

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bb -ci-github-create-release

- name: Inform Cljdoc
run: bb -ci-cljdoc-request-build
49 changes: 49 additions & 0 deletions .github/workflows/shared-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'shared setup'
inputs:
jdk:
description: 'jdk version'
required: true
shell:
# shell must be specified for run:s for composite actions
description: 'which shell to use'
required: false
default: bash

runs:
using: 'composite'

steps:
- name: Clojure deps cache
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.deps.clj
~/.gitlibs
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ inputs.jdk }}

- name: Install Clojure Tools
uses: DeLaGuardo/[email protected]
with:
cli: 'latest'
bb: 'latest'

- name: Tools Versions
shell: ${{ inputs.shell }}
run: |
echo "java -version"
java -version
echo "bb --version"
bb --version
echo "clojure --version"
clojure --version
- name: Download Clojure Dependencies
shell: ${{ inputs.shell }}
run: bb download-deps
70 changes: 70 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: tests
on:
# allow this workflow to be called from other workflows, namely: publish
workflow_call:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup
uses: ./.github/workflows/shared-setup
with:
jdk: '11'

- name: Lint
run: bb lint

test-jvm:
runs-on: ${{ matrix.os.name }}-latest
strategy:
fail-fast: false
matrix:
os: [{name: 'windows', shell: 'pwsh'}, {name: 'ubuntu', shell: 'bash'}]
clojure-version: ["1.8", "1.9", "1.10", "1.11"]
jdk: ['8', '11', '17']

name: ${{ matrix.os.name }} clj-${{ matrix.clojure-version }} jdk${{ matrix.java-version }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/workflows/shared-setup
with:
jdk: ${{ matrix.jdk }}
shell: ${{ matrix.os.shell }}

- name: Run tests
run: bb test:jvm --clj-version ${{ matrix.clojure-version }}

test-bb:
runs-on: ${{ matrix.os.name }}-latest
strategy:
fail-fast: false
matrix:
os: [{name: 'windows', shell: 'pwsh'}, {name: 'ubuntu', shell: 'bash'}]

name: ${{ matrix.os.name }} bb

steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup
uses: ./.github/workflows/shared-setup
with:
jdk: '11'
shell: ${{ matrix.os.shell }}

- name: Run tests
run: bb test:bb
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
build
target
lib
*.dot
Expand All @@ -7,7 +6,6 @@ lib
syntax: glob
creds.clj
Manifest.txt
pom.xml
aws.clj
*.ser
*.class
Expand Down
Loading

0 comments on commit 5cdeb5f

Please sign in to comment.