Skip to content

Commit

Permalink
Deploy build (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 authored Dec 20, 2023
1 parent 6352e2c commit ee32853
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,46 @@ jobs:
lein: latest
- name: Run tests
run: lein do clean, all midje, all check
deploy:
concurrency: deploy
needs: test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
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/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Configure settings.xml
run: |
mkdir -p ~/.m2
echo "<settings><servers><server></id><username>${{ secrets.CLOJARS_USER }}</username><password>${{ secrets.CLOJARS_TOKEN }}</password></server></servers></settings>" > ~/.m2/settings.xml
- name: deploy
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
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
else
lein deploy snapshot
fi
- run: rm -f ~/.m2/settings.xml
if: ${{ always() }}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ One can add extra meta-data, including descriptions to schema elements using `ri
; :additionalProperties false}}
```
## Release process
To release a version, set the project.clj version to the one you want to release, but with a `-SNAPSHOT` suffix.
Then create a commit reading "Release :{major,minor,patch}" based on whether
you want the next development version to be a major/minor/patch increment.
Push to master, and the GitHub Actions release will release the jar to clojars, then bump the version
on the master branch.
## License
Copyright © 2014-2018 [Metosin Oy](http://www.metosin.fi)
Expand Down
17 changes: 15 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject metosin/ring-swagger "0.26.2"
(defproject metosin/ring-swagger "0.26.3-SNAPSHOT"
:description "Swagger Spec for Ring Apps"
:url "https://github.com/metosin/ring-swagger"
:license {:name "Eclipse Public License"
Expand Down Expand Up @@ -35,6 +35,19 @@
:target "gh-pages/doc"
:src-uri "http://github.com/metosin/ring-swagger/blob/master/"
:src-uri-prefix "#L"}
:deploy-repositories [["releases" :clojars]]
:deploy-repositories [["snapshot" {:url "https://clojars.org/repo"
:sign-releases false}]
["release" {:url "https://clojars.org/repo"
:sign-releases false}]]
:release-tasks [["clean"]
["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
["vcs" "commit"]
["vcs" "tag" "--no-sign"]
["deploy" "release"]
["change" "version" "leiningen.release/bump-version"]
["vcs" "commit"]
["vcs" "push"]]

:aliases {"all" ["with-profile" "dev:dev,1.7:dev,1.9:dev,1.10:dev,1.11:dev,1.12"]
"test-ancient" ["midje"]})

0 comments on commit ee32853

Please sign in to comment.