Skip to content

Commit

Permalink
v1.11.1.1189
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 3, 2022
1 parent 5071ff5 commit 8997d8f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
mkdir -p /tmp/release
lein do clean, uberjar
VERSION=$(cat resources/DEPS_CLJ_VERSION)
cp target/deps.clj-$VERSION-standalone.jar /tmp/release
artifact="target/deps.clj-$VERSION-standalone.jar"
cp "$artifact" /tmp/release
bb upload-artifact :file "$artifact"
- store_artifacts:
path: /tmp/release
destination: release
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
command: |
bash <(curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install) --dir ~
sudo mv ~/bb /usr/local/bin/bb
bb --version
- run:
name: Install lsof
command: |
Expand Down
9 changes: 7 additions & 2 deletions .circleci/script/release
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ cp deps /tmp/release

VERSION=$(cat resources/DEPS_CLJ_VERSION)

cd /tmp/release
pushd /tmp/release

## release binary as zip archive

zip "deps.clj-$VERSION-$DEPS_CLJ_PLATFORM-amd64.zip" deps
artifact="deps.clj-$VERSION-$DEPS_CLJ_PLATFORM-amd64.zip"
zip "$artifact" deps

popd

bb upload-artifact :file "/tmp/release/$artifact"

rm deps
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ build_script:
echo Creating zip archive
jar -cMf deps.clj-%DEPS_CLJ_VERSION%-windows-amd64.zip deps.exe
set ARTIFACT=deps.clj-%DEPS_CLJ_VERSION%-windows-amd64.zip
jar -cMf %ARTIFACT% deps.exe
bb upload-artifact :file %ARTIFACT%
dir
Expand Down
7 changes: 5 additions & 2 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{:paths ["resources" "bb"]
:deps {io.github.borkdude/gh-release-artifact {:git/sha "db5e79559fdbfa009ed4a0921079e20e1e76b269"}}

:min-bb-version "1.0.165"

:tasks
{:requires [[babashka.deps :as deps]
[babashka.fs :as fs]
Expand Down Expand Up @@ -36,4 +37,6 @@
:task (doseq [task '[jvm-clj-test jvm-deps-test]]
(println :running... task)
(run task)
(println))}}}
(println))}

upload-artifact {:task (exec 'artifact/upload)}}}
30 changes: 30 additions & 0 deletions bb/artifact.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(ns artifact
(:require [borkdude.gh-release-artifact :as ghr]
[clojure.java.shell :refer [sh]]
[clojure.string :as str]))

(defn current-branch []
(or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
(System/getenv "APPVEYOR_REPO_BRANCH")
(System/getenv "CIRCLE_BRANCH")
(System/getenv "GITHUB_REF_NAME")
(System/getenv "CIRRUS_BRANCH")
(-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD")
:out
str/trim)))

(defn upload [opts]
(assert (:file opts) "File is required")
(let [ght (System/getenv "GITHUB_TOKEN")
current-version
(-> (slurp "resources/DEPS_CLJ_VERSION")
str/trim)
branch (current-branch)]
(if (and ght (contains? #{"master" "main"} branch))
(ghr/release-artifact (merge {:org "borkdude"
:repo "deps.clj"
:tag (str "v" current-version)
:file "README.md"
:sha256 true}
opts))
(println "Skipping release artifact (no GITHUB_TOKEN or not on main branch)"))))
2 changes: 1 addition & 1 deletion resources/DEPS_CLJ_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.1.1183-SNAPSHOT
1.11.1.1189

0 comments on commit 8997d8f

Please sign in to comment.