From 76e5363ff2cd812a7e9541397d1799cbba221061 Mon Sep 17 00:00:00 2001 From: liquidz Date: Sat, 6 Aug 2022 07:55:33 +0900 Subject: [PATCH] chore: Tweak workflow for snapshot deployment --- .github/workflows/release.yml | 12 ++++++++---- build.clj | 10 +++++----- resources/version.txt | 2 +- script/deploy_snapshot.bash | 6 ++++++ 4 files changed, 20 insertions(+), 10 deletions(-) create mode 100755 script/deploy_snapshot.bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae6eeae..7ac8dde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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}} diff --git a/build.clj b/build.clj index acd6613..3d64811 100644 --- a/build.clj +++ b/build.clj @@ -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 @@ -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 diff --git a/resources/version.txt b/resources/version.txt index ac322a4..57dde22 100644 --- a/resources/version.txt +++ b/resources/version.txt @@ -1 +1 @@ -1.2.455-SNAPSHOT \ No newline at end of file +1.2.455 \ No newline at end of file diff --git a/script/deploy_snapshot.bash b/script/deploy_snapshot.bash new file mode 100755 index 0000000..dc1b55d --- /dev/null +++ b/script/deploy_snapshot.bash @@ -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\""