Release Clojure SDK #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
--- | |
name: Release Clojure SDK | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ./** | |
- .github/workflows/release-sdk.yml | |
pull_request: | |
paths: | |
- ./** | |
- .github/workflows/release-sdk.yml | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: "Publish artifacts to Clojars" | |
required: true | |
type: boolean | |
default: false | |
jobs: | |
build-clojure: | |
runs-on: ubuntu-24.04 | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.22 | |
- name: Setup java 21 as default java | |
run: | | |
echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Install clojure + tools | |
uses: DeLaGuardo/setup-clojure@ada62bb3282a01a296659d48378b812b8e097360 # tag 13.2 | |
with: | |
cli: latest | |
bb: latest | |
- name: Cache clojure dependencies | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # tag: v4.2.3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
~/.deps.clj | |
key: cljdeps-${{ hashFiles('**/deps.edn') }} | |
restore-keys: cljdeps- | |
- name: Run Clojure test suite | |
run: bb test:all | |
- name: Run Babashka test suite | |
run: bb test:bb | |
- name: Build jar artifacts | |
run: bb install:all | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: sdk.jar | |
path: libraries/sdk/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: brotli.jar | |
path: libraries/sdk-brotli/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: adapter-http-kit.jar | |
path: libraries/sdk-http-kit/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: adapter-http-kit-malli-schemas.jar | |
path: libraries/sdk-http-kit-malli-schemas/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: malli-schemas.jar | |
path: libraries/sdk-malli-schemas/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: adapter-ring.jar | |
path: libraries/sdk-ring/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag: v4.6.2 | |
with: | |
name: adapter-ring-malli-schemas.jar | |
path: libraries/sdk-ring-malli-schemas/target/*.jar | |
if-no-files-found: error | |
compression-level: 0 | |
- name: Publish artifacts to clojars | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' | |
env: | |
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | |
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | |
run: bb publish:all |