Skip to content

Commit

Permalink
deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Dec 20, 2023
1 parent 85d9d3b commit d0c0af0
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run tests

on:
push:
branches: [test-threadgrid-ci]
branches: [master]
pull_request:
branches: [master]

Expand Down Expand Up @@ -44,3 +44,43 @@ jobs:
lein: latest
- name: Run tests
run: lein do clean, all midje, all check
deploy:
concurrency: deploy
needs: test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: turtlequeue/setup-babashka@5e0acf2cf146558d93a573e339e1d24f2758adfd
with:
babashka-version: ${{env.BABASHKA_VERSION}}
- name: Prepare java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: deploy
env:
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Metosin Automated Release"
if [[ "$COMMIT_MSG" == "Release :major" ]]; then
lein release :major
elif [[ "$COMMIT_MSG" == "Release :minor" ]]; then
lein release :minor
elif [[ "$COMMIT_MSG" == "Release :patch" ]]; then
lein release :patch
else
lein deploy snapshot
fi

0 comments on commit d0c0af0

Please sign in to comment.