Automatically upload artifacts to Github release
This commit is contained in:
parent
ff460f323d
commit
c39fc76702
5 changed files with 50 additions and 5 deletions
26
.build/bb.edn
Normal file
26
.build/bb.edn
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{:deps {borkdude/gh-release-artifact
|
||||||
|
#_{:local/root "../gh-release-artifact"}
|
||||||
|
{:git/url "https://github.com/borkdude/gh-release-artifact"
|
||||||
|
:sha "fc00f75f4ba9ab6bd9f228e9ed288e019a534e0c"}}
|
||||||
|
:tasks {:requires ([clojure.string :as str])
|
||||||
|
-current-sha {:requires ([clojure.java.shell :refer [sh]])
|
||||||
|
:task (-> (sh "git" "rev-parse" "HEAD")
|
||||||
|
:out
|
||||||
|
str/trim)}
|
||||||
|
-current-version {:task (-> (slurp "resources/BABASHKA_VERSION")
|
||||||
|
str/trim)}
|
||||||
|
-github-token (if-let [ght (System/getenv "GITHUB_TOKEN")]
|
||||||
|
ght
|
||||||
|
(do
|
||||||
|
(println "Terminating early since GITHUB_TOKEN wasn't set")
|
||||||
|
(System/exit 0)))
|
||||||
|
release-artifact {:requires ([borkdude.gh-release-artifact :as ghr])
|
||||||
|
:depends [-github-token -current-sha -current-version]
|
||||||
|
:task (let [file (first *command-line-args*)]
|
||||||
|
(assert file "File name must be provided")
|
||||||
|
(ghr/overwrite-asset {:org "babashka"
|
||||||
|
:repo "babashka"
|
||||||
|
:file file
|
||||||
|
:commit -current-sha
|
||||||
|
:tag (str "v" -current-version)})
|
||||||
|
nil)}}}
|
||||||
|
|
@ -56,7 +56,13 @@ jobs:
|
||||||
mkdir -p /tmp/release
|
mkdir -p /tmp/release
|
||||||
script/uberjar
|
script/uberjar
|
||||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||||
cp target/babashka-$VERSION-standalone.jar /tmp/release/babashka-$VERSION-standalone.jar
|
jar=target/babashka-$VERSION-standalone.jar
|
||||||
|
cp $jar /tmp/release
|
||||||
|
|
||||||
|
java -jar $jar script/reflection.clj
|
||||||
|
reflection="babashka-$VERSION-reflection.json"
|
||||||
|
BABASHKA_EDN=".build/bb.edn" java -jar "$jar" release-artifact "$jar"
|
||||||
|
BABASHKA_EDN=".build/bb.edn" java -jar "$jar" release-artifact "$reflection"
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/release
|
path: /tmp/release
|
||||||
destination: release
|
destination: release
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,13 @@ if [ "$BABASHKA_STATIC" = "true" ]; then
|
||||||
arch="$arch-static"
|
arch="$arch-static"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar zcvf "babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz" bb # bbk
|
archive="babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz"
|
||||||
|
|
||||||
|
tar zcvf "$archive" bb # bbk
|
||||||
|
|
||||||
|
cd -
|
||||||
|
|
||||||
|
BABASHKA_EDN=".build/bb.edn" ./bb release-artifact "/tmp/release/$archive"
|
||||||
|
|
||||||
## cleanup
|
## cleanup
|
||||||
|
|
||||||
|
|
|
||||||
10
appveyor.yml
10
appveyor.yml
|
|
@ -52,6 +52,16 @@ build_script:
|
||||||
|
|
||||||
call script/compile.bat
|
call script/compile.bat
|
||||||
|
|
||||||
|
echo Creating zip archive
|
||||||
|
|
||||||
|
set zip=babashka-%BABASHKA_VERSION%-windows-amd64.zip
|
||||||
|
|
||||||
|
jar -cMf %zip% bb.exe
|
||||||
|
|
||||||
|
set BABASHKA_EDN=.build/bb.edn
|
||||||
|
|
||||||
|
bb release-artifact %zip%
|
||||||
|
|
||||||
# - cmd: >-
|
# - cmd: >-
|
||||||
# lein clean
|
# lein clean
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,3 @@ call %GRAALVM_HOME%\bin\native-image.cmd ^
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
call bb "(+ 1 2 3)"
|
call bb "(+ 1 2 3)"
|
||||||
|
|
||||||
echo Creating zip archive
|
|
||||||
jar -cMf babashka-%BABASHKA_VERSION%-windows-amd64.zip bb.exe
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue