Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 39 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,16 @@ on:
workflow_dispatch: {} # manual run for testing; publishing remains tag-only

permissions:
contents: write # create the GitHub Release
contents: read

jobs:
release:
guards:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- uses: DeLaGuardo/setup-clojure@13.6.1
with:
cli: latest

- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('deps.edn') }}
restore-keys: ${{ runner.os }}-m2-

- name: Verify tag matches build.clj version
if: github.ref_type == 'tag'
run: |
Expand Down Expand Up @@ -88,10 +73,6 @@ jobs:
done < <(grep -oE "net\.clojars\.[a-zA-Z0-9._/-]+ \{:mvn/version \"[^\"]+\"\}" "$f" | grep -F "$LIB {:mvn/version" | grep -oE '"[^"]+"' | tr -d '"')
done
exit $rc
- name: Test
run: |
clojure -T:build compile-java
clojure -M:test

- name: Verify tag commit is on main
if: github.ref_type == 'tag'
Expand All @@ -118,6 +99,43 @@ jobs:
fi
cat release-notes.md

- name: Upload release notes
if: github.ref_type == 'tag'
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release-notes.md

verify:
needs: guards
uses: ./.github/workflows/test-matrix.yml

release:
needs: [guards, verify]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- uses: DeLaGuardo/setup-clojure@13.6.1
with:
cli: latest
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('deps.edn') }}
restore-keys: ${{ runner.os }}-m2-
- uses: actions/download-artifact@v4
if: github.ref_type == 'tag'
with:
name: release-notes

- name: Deploy to Clojars
if: github.ref_type == 'tag'
env:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test matrix

on:
workflow_call:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: ['17', '21']
clojure: ['1.10', '1.11', '1.12']
name: jdk ${{ matrix.jdk }} / clojure ${{ matrix.clojure }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- uses: DeLaGuardo/setup-clojure@13.6.1
with:
cli: latest
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: m2-${{ hashFiles('deps.edn') }}
restore-keys: m2-
- run: clojure -T:build compile-java
- run: clojure -M:${{ matrix.clojure }}:test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clj-kondo
run: |
curl -sSL https://raw.githubusercontent.com/clj-kondo/clj-kondo/v2026.08.04/script/install-clj-kondo | bash -s -- --dir "$HOME/.local/bin" --version 2026.08.04
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Lint
run: clj-kondo --lint src test --fail-level error
35 changes: 1 addition & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,4 @@ permissions:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: ['17', '21']
clojure: ['1.10', '1.11', '1.12']
name: jdk ${{ matrix.jdk }} / clojure ${{ matrix.clojure }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- uses: DeLaGuardo/setup-clojure@13.6.1
with:
cli: latest
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: m2-${{ hashFiles('deps.edn') }}
restore-keys: m2-
- run: clojure -T:build compile-java
- run: clojure -M:${{ matrix.clojure }}:test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clj-kondo
run: |
curl -sSL https://raw.githubusercontent.com/clj-kondo/clj-kondo/v2026.08.04/script/install-clj-kondo | bash -s -- --dir "$HOME/.local/bin" --version 2026.08.04
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Lint
run: clj-kondo --lint src test --fail-level error
uses: ./.github/workflows/test-matrix.yml
Loading