Skip to content

Deploy to Clojars

Deploy to Clojars #7

# Deploy the cuurent project to Clojars
# All deployments use the Wall Brew Bot user
name: Deploy to Clojars
on:
workflow_dispatch:
jobs:
deploy:
# This job requires the Wall Brew Bot Token, so it is only run on non-forked repositories
if: github.repository_owner == 'Wall-Brew-Co'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
id: checkout
uses: actions/[email protected]
- name: Cache Maven Dependencies
id: cache-maven
uses: actions/cache@v4
env:
cache-name: cache-maven
with:
path: ~/.m2
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-clj
- name: Install Clojure Dependencies
id: install-deps
run: lein deps
# This isn't strictly required to deploy, but is a quality check against our documentation
- name: Validate Changelog Status
id: validate-changelog
run: lein sealog check
# This helps us ensure that we are deploying the correct version
- name: Display Version
id: display-version
run: lein sealog version
# This is a sanity check to ensure that the project is in a good state
- name: Run Sanity Tests
id: sanity-test
run: lein test
# Compile the project into a jar file
# This is the file that will be deployed to Clojars and is the final gate before deployment
- name: Run Build Test
id: build-test
run: lein jar
- name: Publish To Clojars
id: publish
env:
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}
run: lein deploy clojars
- name: Resolve version
id: versionchk
run: echo "VERSION=$(lein sealog version project.clj | tail -n 1)" >> $GITHUB_OUTPUT
# Push a tag to the repository to mark the version
# This also helps Renovate locate Change Notes for dependency update PRs
- name: Push Tag
id: push-tag
uses: hole19/[email protected]
env:
TAG: v${{ steps.versionchk.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.WALL_BREW_BOT_PAT }}
# This file was automatically copied and populated by rebroadcast
# Do not edit this file directly, instead modify the source at https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/github-actions/workflows/deploy_to_clojars.yml