Skip to content

Merge pull request #8 from k-kom/fix/update-dependency #30

Merge pull request #8 from k-kom/fix/update-dependency

Merge pull request #8 from k-kom/fix/update-dependency #30

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.11.1'
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: cljdeps-${{ hashFiles('project.clj') }}
restore-keys: cljdeps-
- name: Run tests
run: lein with-profile +1.9:+1.10:+1.11 test
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
echo "version=$(head -n 1 project.clj | sed -e 's/^(defproject.*\"\(.*\)\"$/\1/')" \
>> "$GITHUB_OUTPUT"
deploy:
if: ${{ github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
endsWith(needs.get-version.outputs.version, '-SNAPSHOT') }}
needs: [test, get-version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.11.1'
- name: Deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: lein deploy snapshots