Skip to content

Commit

Permalink
WIP: Add deploy step to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
totakke committed Feb 6, 2024
1 parent 5f108e5 commit eeee19f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,46 @@ jobs:

- name: Run tests
run: lein with-profile +1.9:+1.10:+1.11 test

get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get version
id: get-version
run: |
echo "version=$(head -n 1 project.clj | sed -e 's/^(defproject.*\"\(.*\)\"$/\1/')" \
>> "$GITHUB_OUTPUT"
deploy:
if: ${{ github.event_name == 'push' &&
# github.ref == 'refs/heads/master' &&
github.ref == 'refs/heads/fix/ci' &&
endsWith(needs.get-version.outputs.version, '-SNAPSHOT') }}
needs: [test, get-version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.11.1'

- name: Deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: lein deploy snapshots

0 comments on commit eeee19f

Please sign in to comment.