From 46eb13582eb6ee988ed0ec50195b604b2314957f Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 15 Sep 2026 16:34:00 +0300 Subject: [PATCH 1/4] Create GitHub releases from the changelog Releases have been created by hand so far. This creates one whenever a v* tag is pushed, with the version's CHANGELOG.md section as the notes (the unreleased section for a prerelease that has no section of its own yet, and GitHub's generated notes only if both are empty). Snapshot tags are skipped. --- .github/workflows/github-release.yml | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/github-release.yml diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 0000000..97422df --- /dev/null +++ b/.github/workflows/github-release.yml @@ -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 }} From 4f6a0c12be89f540daeb7b9727816d954c817a15 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 15 Sep 2026 16:34:00 +0300 Subject: [PATCH 2/4] Let dependabot keep the GitHub Actions current Monthly, so it stays a trickle rather than a stream of PRs. --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3a626c3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly From 23b2c8b53f74eff4c9874c6bbc8e6822ad7b1287 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 15 Sep 2026 16:34:00 +0300 Subject: [PATCH 3/4] Move the CI actions off the Node 20 runtime GitHub removes Node 20 from the hosted runners on 2026-09-23; checkout, setup-java, setup-node, cache and setup-clojure all have Node 24 majors. --- .github/workflows/ci.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27fea00..de8085c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 From de687dfedb08c98ede2a5f9391d3be7dcd3f2943 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 15 Sep 2026 16:34:00 +0300 Subject: [PATCH 4/4] Give make install a default version and stop make test wiping the cache A bare make install failed asking for PROJECT_VERSION, although build.clj already falls back to a placeholder. Default it to 99.99 and keep the guard where it matters: make deploy refuses the default. make test ran clean first, which deleted .cpcache and had every run recompute the classpath. The phony list also named a nrepl target that doesn't exist instead of nrepl-figwheel and nrepl-shadow. --- Makefile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7aac0fa..cc8223d 100644 --- a/Makefile +++ b/Makefile @@ -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 \ @@ -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 @@ -28,7 +31,7 @@ eastwood: lint: kondo eastwood -install: check-install-env +install: clojure -T:build install deploy: check-ci-env @@ -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