Skip to content

Commit

Permalink
chore: Tweak workflow for snapshot deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Aug 5, 2022
1 parent 2a63604 commit 76e5363
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ jobs:
path: ~/.m2
key: clojure-m2-${{ hashFiles('deps.edn') }}

- run: make inline-deps

- name: deploy snapshot to clojars
if: ${{ inputs.snapshot }}
run: bash script/deploy_snapshot.bash

- name: deploy to clojars
id: deploy
run: |
make inline-deps
clojure -T:build deploy
if: ${{ ! inputs.snapshot }}
run: clojure -T:build deploy
env:
CLOJARS_PASSWORD: ${{secrets.CLOJARS_PASSWORD}}
CLOJARS_USERNAME: ${{secrets.CLOJARS_USERNAME}}
Expand Down
10 changes: 5 additions & 5 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

(def ^:private build-config
{:lib 'com.github.liquidz/iced-nrepl
:version "1.2.{{git/commit-count}}-SNAPSHOT"
:version "1.2.{{git/commit-count}}"
:description "nREPL middleware for vim-iced"
:documents [{:file "resources/version.txt"
:action :create
Expand Down Expand Up @@ -108,15 +108,15 @@
(defn install
[m]
(-> (merge (inlined-build-config)
m
{:version (fixed-version)})
{:version (fixed-version)}
m)
(build-edn/install)))

(defn deploy
[m]
(-> (merge (inlined-build-config)
m
{:version (fixed-version)})
{:version (fixed-version)}
m)
(build-edn/deploy)))

(defn update-documents
Expand Down
2 changes: 1 addition & 1 deletion resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.455-SNAPSHOT
1.2.455
6 changes: 6 additions & 0 deletions script/deploy_snapshot.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(cd $(dirname $0); pwd)
VERSION=$(cat "${SCRIPT_DIR}/../resources/version.txt")

clojure -T:build install :version "\"${VERSION}-SNAPSHOT\""

0 comments on commit 76e5363

Please sign in to comment.