add snapshot on deploy
This commit is contained in:
parent
feb0c9a6f8
commit
ed844ed057
4 changed files with 57 additions and 5 deletions
48
.github/workflows/test-and-snapshot.yml
vendored
Normal file
48
.github/workflows/test-and-snapshot.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Clojure CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build-and-snapshot:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11'
|
||||
cache: 'maven'
|
||||
- name: Setup Clojure
|
||||
uses: DeLaGuardo/setup-clojure@master
|
||||
with:
|
||||
tools-deps: '1.10.3.986'
|
||||
- name: Run Tests
|
||||
run: clojure -T:build ci :snapshot true
|
||||
- name: Deploy Snapshot
|
||||
run: clojure -T:build deploy :snapshot true
|
||||
env:
|
||||
CLOJARS_PASSWORD: ${{secrets.DEPLOY_TOKEN}}
|
||||
CLOJARS_USERNAME: ${{secrets.DEPLOY_USERNAME}}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '8', '14', '15', '16', '17' ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: 'maven'
|
||||
- name: Clojure CLI
|
||||
uses: DeLaGuardo/setup-clojure@master
|
||||
with:
|
||||
tools-deps: '1.10.3.986'
|
||||
- name: Run Tests
|
||||
run: clojure -T:build ci
|
||||
- name: Check cljdoc.edn
|
||||
run: curl -fsSL https://raw.githubusercontent.com/cljdoc/cljdoc/master/script/verify-cljdoc-edn | bash -s doc/cljdoc.edn
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -1,6 +1,6 @@
|
|||
name: Clojure CI
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ SQL as Clojure data structures. Build queries programmatically -- even at runtim
|
|||
|
||||
[](https://clojars.org/com.github.seancorfield/honeysql) [](https://cljdoc.org/d/com.github.seancorfield/honeysql/CURRENT)
|
||||
|
||||
Once the prerelease testing is complete, this project will follow the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository.
|
||||
This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository.
|
||||
|
||||
> Note: every commit to the **develop** branch runs CI (GitHub Actions) and successful runs push a MAJOR.MINOR.999-SNAPSHOT build to Clojars so the very latest version of `next.jdbc` is always available either via that [snapshot on Clojars](https://clojars.org/com.github.seancorfield/honeysql) or via a git dependency on the latest SHA.
|
||||
|
||||
HoneySQL 2.x requires Clojure 1.9 or later.
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@
|
|||
[org.corfield.build :as bb]))
|
||||
|
||||
(def lib 'com.github.seancorfield/honeysql)
|
||||
(def version (format "2.0.%s" (b/git-count-revs nil)))
|
||||
(defn- the-version [patch] (format "2.0.%s" patch))
|
||||
(def version (the-version (b/git-count-revs nil)))
|
||||
(def snapshot (the-version "999-SNAPSHOT"))
|
||||
|
||||
(defn eastwood "Run Eastwood." [opts]
|
||||
(-> opts (bb/run-task [:eastwood])))
|
||||
|
|
@ -51,7 +53,7 @@
|
|||
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
|
||||
(-> opts
|
||||
(bb/clean)
|
||||
(assoc :lib lib :version version)
|
||||
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
|
||||
(as-> opts
|
||||
(reduce (fn [opts alias]
|
||||
(run-doc-tests (assoc opts :aliases [alias])))
|
||||
|
|
@ -68,5 +70,5 @@
|
|||
|
||||
(defn deploy "Deploy the JAR to Clojars." [opts]
|
||||
(-> opts
|
||||
(assoc :lib lib :version version)
|
||||
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
|
||||
(bb/deploy)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue