Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate deployments #6

Merged
merged 4 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/deploy_to_clojars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy to Clojars

on:
workflow_dispatch:


jobs:
deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3.0.2

- name: Cache maven dependencies
uses: actions/cache@v3
env:
cache-name: cache-maven
with:
path: ~/.m2
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-clj

- name: Install Clojure dependencies
run: |
lein deps && lein project-version

- name: Run sanity tests
run: lein test

- name: Run build test
run: lein jar

- name: Publish to Clojars
env:
CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}
run: lein deploy clojars

- name: Resolve version
id: versionchk
run: echo "::set-output name=VERSION::$(lein project-version)"

- name: Push Tag
uses: hole19/git-tag-action@v1.0
env:
TAG: v"${{ steps.versionchk.outputs.VERSION }}"
GITHUB_TOKEN: ${{ secrets.WALL_BREW_BOT_PAT }}
7 changes: 6 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/clojurescript "1.11.60" :scope "provided"]]
:plugins [[lein-cljsbuild "1.1.8"]]
:plugins [[lein-cljsbuild "1.1.8"]
[lein-project-version "0.1.0"]]
:resource-paths ["resources"]
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
:username :env/clojars_user
:password :env/clojars_pass
:sign-releases false}]]

:aliases {"test-build" ["do" "clean" ["cljsbuild" "once" "test"] ["doo" "once"] ["test"]]}

Expand Down