Skip to content

Commit

Permalink
Merge pull request #7 from toyokumo/remove-leiningen
Browse files Browse the repository at this point in the history
Remove leiningen and bump deps
  • Loading branch information
egs33 committed Dec 15, 2023
2 parents 79dafd7 + 6836aa5 commit 547f9aa
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 22 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tag and Release

on: workflow_dispatch

jobs:
tag-and-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
java-package: jdk
architecture: x64

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

- name: Show versions
run: |
java -version
clojure --version
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.m2
key: clj-cache-${{ hashFiles('**/deps.edn') }}
restore-keys: |
clj-cache-
- name: Deploy to clojars
id: deploy
run: clojure -T:build deploy
env:
CLOJARS_PASSWORD: ${{secrets.CLOJARS_PASSWORD}}
CLOJARS_USERNAME: ${{secrets.CLOJARS_USERNAME}}

- name: Create tag and release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.deploy.outputs.version }}
release_name: ${{ steps.deploy.outputs.version }}
body: released
draft: false
prerelease: false

- name: Update documents
run: |
clojure -T:build update-documents
git diff
git config --global user.email "github-actions@example.com"
git config --global user.name "github-actions"
git add -A
git commit -m "Update for release" || exit 0
git push
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ jobs:
clj_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: 0918nobita/setup-cljstyle@v0.2.0
- uses: actions/checkout@v4
- uses: DeLaGuardo/setup-clojure@master
with:
cljstyle-version: 0.14.0
cljstyle: 0.15.0
- run: cljstyle check --report -v

test:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 15]
java: [8, 11, 17, 21]
name: Test (Java ${{ matrix.java }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-package: jdk
architecture: x64
distribution: 'zulu'

- uses: DeLaGuardo/setup-clojure@master
with:
lein: '2.9.4'
cli: latest

- name: Cache dependencies
uses: toyokumo/cache@main
uses: actions/cache@v3
with:
path: |
~/.m2
~/.lein
key: clj-cache-${{ hashFiles('**/project.clj') }}
key: clj-cache-${{ hashFiles('**/deps.edn') }}
restore-keys: |
clj-cache-
- name: Run tests
run: lein test
run: clojure -M:dev:test

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pom.xml.asc
/.nrepl-port
.idea
*.iml
.cpcache
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log
## Unreleased
### Breaking
- Use deps.edn instead of Leiningen.

## 0.3.0
### ADDED
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ring-middleware-csp
Ring middleware for Content Security Policy

[![CircleCI](https://circleci.com/gh/toyokumo/ring-middleware-csp.svg?style=shield&circle-token=445e8d5d3a86d16e9daf345e032a8f9b10cdb084)](https://app.circleci.com/pipelines/github/toyokumo/ring-middleware-csp)
[![Lint and Test](https://github.com/toyokumo/ring-middleware-csp/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/toyokumo/ring-middleware-csp/actions/workflows/test.yml)
[![cljdoc badge](https://cljdoc.org/badge/toyokumo/ring-middleware-csp)](https://cljdoc.org/d/toyokumo/ring-middleware-csp/CURRENT)
[![Clojars Project](https://img.shields.io/clojars/v/toyokumo/ring-middleware-csp.svg)](https://clojars.org/toyokumo/ring-middleware-csp)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down Expand Up @@ -124,7 +124,7 @@ e.g.

## Testing
```
lein test
clojure -M:dev:test
```

## Formatting
Expand Down
10 changes: 10 additions & 0 deletions build.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{:lib toyokumo/ring-middleware-csp
:version "0.4.{{git/commit-count}}"
:description "Ring middleware for Content Security Policy"
:licenses [{:name "Apache, Version 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}]
:documents [{:file "CHANGELOG.md"
:match "Unreleased"
:action :append-after
:text "\n## {{version}}"}]
:github-actions? true}
10 changes: 10 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{:paths ["src" "resources"],
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}

:aliases
{:dev {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"}}}
:test {:main-opts ["-m" "kaocha.runner"]}
:build {:deps {com.github.liquidz/build.edn {:git/tag "0.11.241"
:git/sha "277bf6ebfbf8f38acbffa33a1670f5965bf4634f"}}
:ns-default build-edn.main}}}
9 changes: 0 additions & 9 deletions project.clj

This file was deleted.

6 changes: 6 additions & 0 deletions tests.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#kaocha/v1
{:fail-fast? true
:color? true
:reporter [kaocha.report/documentation]
:plugins [:kaocha.plugin/profiling
:kaocha.plugin/print-invocations]}

0 comments on commit 547f9aa

Please sign in to comment.