Skip to content
Open
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ jobs:
- {jdk: 11, clojure: 'master'}
- {jdk: 17, clojure: 'master'}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
- uses: DeLaGuardo/setup-clojure@12.5
- uses: DeLaGuardo/setup-clojure@13.7.0
with:
cli: latest
- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.m2/repository
Expand All @@ -52,21 +52,21 @@ jobs:
name: Lint (clj-kondo + Eastwood)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6
- uses: actions/setup-java@v6
with:
distribution: temurin
# Eastwood loads the shadow-cljs dev namespaces, and shadow-cljs 3.x
# requires JDK 21.
java-version: 21
- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
- uses: DeLaGuardo/setup-clojure@12.5
- uses: DeLaGuardo/setup-clojure@13.7.0
with:
cli: latest
- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.m2/repository
Expand All @@ -83,20 +83,20 @@ jobs:
name: shadow-cljs integration test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6
- uses: actions/setup-java@v6
with:
distribution: temurin
# shadow-cljs 3.x requires JDK 21.
java-version: 21
- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
- uses: DeLaGuardo/setup-clojure@12.5
- uses: DeLaGuardo/setup-clojure@13.7.0
with:
cli: latest
- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.m2/repository
Expand All @@ -116,12 +116,12 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- uses: actions/checkout@v6
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 21
- uses: DeLaGuardo/setup-clojure@12.5
- uses: DeLaGuardo/setup-clojure@13.7.0
with:
cli: latest
- name: Compute version from tag
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Create GitHub Release

on:
push:
tags:
- "v*" # Trigger when a version tag is pushed (e.g., v1.0.0)

jobs:
create-release:
# Snapshot tags only exist to exercise the deploy pipeline.
if: ${{ !endsWith(github.ref_name, '-SNAPSHOT') }}
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout Code
uses: actions/checkout@v6

# The release notes are the version's section of the changelog. A
# prerelease usually has no section of its own yet, so it gets the
# unreleased one. If neither has anything, fall back to GitHub's
# generated notes rather than publish an empty release.
- name: Extract the release notes from the changelog
id: notes
run: |
extract() {
awk -v heading="$1" '
/^## / { if (found) exit; found = ($2 == heading); next }
found { print }
' CHANGELOG.md
}
extract "${GITHUB_REF_NAME#v}" > release-notes.md
if ! grep -q '[^[:space:]]' release-notes.md; then
extract "master" > release-notes.md
fi
if grep -q '[^[:space:]]' release-notes.md; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "::warning::No changelog section for $GITHUB_REF_NAME, using generated notes instead."
echo "found=false" >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: clj-suitable ${{ github.ref_name }}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
bodyFile: ${{ steps.notes.outputs.found == 'true' && 'release-notes.md' || '' }}
generateReleaseNotes: ${{ steps.notes.outputs.found != 'true' }}
token: ${{ secrets.GITHUB_TOKEN }}
21 changes: 10 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.PHONY: clean test shadow-test install deploy nrepl fig-repl kondo eastwood lint
.PHONY: clean test shadow-test install deploy fig-repl nrepl-figwheel nrepl-shadow kondo eastwood lint check-ci-env

VERSION ?= 1.12
# The version local installs get. Releases take theirs from the git tag.
PROJECT_VERSION ?= 99.99
export PROJECT_VERSION

clean:
@-rm -rf target/public/cljs-out \
Expand All @@ -11,7 +14,7 @@ clean:
.cljs_node_repl \
.rebel_readline_history

test: clean
test:
clojure -M:test:test-runner:$(VERSION)

# shadow-cljs integration test - needs JDK 21 and a Node runtime (installs the
Expand All @@ -28,7 +31,7 @@ eastwood:

lint: kondo eastwood

install: check-install-env
install:
clojure -T:build install

deploy: check-ci-env
Expand All @@ -53,11 +56,7 @@ endif
ifndef CLOJARS_PASSWORD
$(error CLOJARS_PASSWORD is undefined)
endif
ifndef PROJECT_VERSION
$(error PROJECT_VERSION is undefined. Deployments are published from git tags by CI - see .github/workflows/ci.yml.)
endif

check-install-env:
ifndef PROJECT_VERSION
$(error Please set PROJECT_VERSION as an env var beforehand.)
endif
@if [ "$(PROJECT_VERSION)" = "99.99" ]; then \
echo "[Error] PROJECT_VERSION is the local default. Deployments are published from git tags by CI - see .github/workflows/ci.yml."; \
exit 1; \
fi