Skip to content

Commit d90a2c4

Browse files
committed
Improve release process
1 parent fea31a1 commit d90a2c4

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
{:hooks
3+
{:analyze-call {org.httpkit.server/with-channel httpkit.with-channel/with-channel}}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(ns httpkit.with-channel
2+
(:require [clj-kondo.hooks-api :as api]))
3+
4+
(defn with-channel [{node :node}]
5+
(let [[request channel & body] (rest (:children node))]
6+
(when-not (and request channel) (throw (ex-info "No request or channel provided" {})))
7+
(when-not (api/token-node? channel) (throw (ex-info "Missing channel argument" {})))
8+
(let [new-node
9+
(api/list-node
10+
(list*
11+
(api/token-node 'let)
12+
(api/vector-node [channel (api/vector-node [])])
13+
request
14+
body))]
15+
16+
{:node new-node})))

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- "!*"
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+*'
9+
10+
jobs:
11+
deploy-clojars:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/[email protected]
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Prepare java
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
23+
- name: Install Clojure
24+
uses: DeLaGuardo/setup-clojure@master
25+
with:
26+
cli: '1.10.3.1013'
27+
bb: '1.3.184'
28+
29+
- name: Deploy Clojars
30+
env:
31+
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
32+
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
33+
run: bb deploy-clojars

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,7 @@ lsp4clj provides one tool to avoid accidental writes to stdout (or rather to `*o
192192
## Known lsp4clj users
193193

194194
- [clojure-lsp](https://clojure-lsp.io/): A Clojure LSP server implementation.
195+
196+
## Release
197+
198+
To release a new version, run `bb tag x.y.z`, it should do all necessary changes and trigger a Github Action to deploy to clojars the new version.

scripts/lsp4clj/ci.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
(replace-in-file "CHANGELOG.md"
1717
#"## Unreleased"
1818
(format "## Unreleased\n\n## v%s" tag))
19-
(shell "git add resources/LSP4CLJ_VERSION CHANGELOG.md")
19+
(shell "clojure -T:build jar")
20+
(shell "git add resources/LSP4CLJ_VERSION CHANGELOG.md pom.xml pom.properties")
2021
(shell (format "git commit -m \"Release: v%s\"" tag))
2122
(shell (str "git tag v" tag))
2223
(shell "git push origin HEAD")

0 commit comments

Comments
 (0)