Skip to content

Bump actions/setup-java from 3.11.0 to 4.5.0 #217

Bump actions/setup-java from 3.11.0 to 4.5.0

Bump actions/setup-java from 3.11.0 to 4.5.0 #217

Workflow file for this run

---
name: Run tests
on:
push:
branches: [master, "1.1.x"]
pull_request:
branches: [master, "1.1.x"]
env:
ACTIONS_CACHE_VERSION: 0
jobs:
test:
strategy:
matrix:
jdk: [8, 11, 17, 21, 22]
name: Java ${{ matrix.jdk }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java ${{ matrix.jdk }}
uses: actions/[email protected]
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- name: Maven Cache
id: maven-cache
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
key: m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-${{ matrix.jdk }}
restore-keys: |
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
lein: latest
- name: Setup Babashka
run: bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
- name: Check dependabot is in sync with project.clj
run: ./scripts/check-dependabot
- name: Run tests
run: lein do clean, all test, all check
deploy:
concurrency: deploy
needs: test
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/1.1.x') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Maven Cache
id: maven-cache
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
key: m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-${{ matrix.jdk }}
restore-keys: |
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-${{ hashFiles('project.clj') }}-
m2-cache-${{ env.ACTIONS_CACHE_VERSION }}-
- name: Prepare java
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '11'
- name: deploy
env:
CLOJARS_USER: metosinci
CLOJARS_TOKEN: "${{ secrets.CLOJARS_DEPLOY_TOKEN }}"
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Ambrose Bonnaire-Sergeant"
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
elif [[ "$COMMIT_MSG" == "Release :alpha" ]]; then
lein release :alpha
elif [[ "$COMMIT_MSG" == "Release :beta" ]]; then
lein release :beta
elif [[ "$COMMIT_MSG" == "Release :rc" ]]; then
lein release :rc
else
lein deploy snapshot
fi