Skip to content

Commit

Permalink
added release path for homebrew (fixes #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerbrandl committed Nov 7, 2017
1 parent 7246ef3 commit d36c2d9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ kscript --self-update

If you have Kotlin and Maven already and you would like to install the latest `kscript` release without using `sdkman` you can do so by unzipping the [latest ](https://github.com/holgerbrandl/kscript/releases/latest) binary release. Don't forget to update your `$PATH` accordingly.

#### Installation with Homebrew

On MacOS you can install `kscript` also with [Homebrew](https://brew.sh/)
```
brew install holgerbrandl/tap/kscript
```

Interpreter Usage
-----------------
Expand Down
36 changes: 36 additions & 0 deletions misc/kscript_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ github-release upload \
### Update release branch

#http://stackoverflow.com/questions/13969050/how-to-create-a-new-empty-branch-for-a-new-project

cd $KSCRIPT_HOME && rm -rf kscript_releases_*

git clone git@github.com:holgerbrandl/kscript.git kscript_releases_${kscript_version}
cd kscript_releases_${kscript_version}
#git checkout --orphan releases
Expand Down Expand Up @@ -145,3 +148,36 @@ curl -X POST \
-d '{"candidate": "kscript", "version": "'${kscript_version}'", "hashtag": "kscript"}' \
https://vendors.sdkman.io/announce/struct


########################################################################
### Update the homebrew descriptor (see https://github.com/holgerbrandl/kscript/issues/50)

cd $KSCRIPT_HOME && rm -rf homebrew-tap
git clone https://github.com/holgerbrandl/homebrew-tap.git
cd homebrew-tap

archiveMd5=$(shasum -a 256 ${KSCRIPT_ARCHIVE}/kscript-${kscript_version}.zip | cut -f1 -d ' ')

cat - <<EOF > kscript.rb
class Kscript < Formula
desc "kscript"
homepage "https://github.com/holgerbrandl/kscript"
url "https://github.com/holgerbrandl/kscript/releases/download/v${kscript_version}/kscript-${kscript_version}-bin.zip"
sha256 "${archiveMd5}"
depends_on "kotlin"
def install
libexec.install Dir["*"]
inreplace "#{libexec}/bin/kscript", /^jarPath=.*/, "jarPath=#{libexec}/bin/kscript.jar"
bin.install_symlink "#{libexec}/bin/kscript"
end
end
EOF

git add kscript.rb
git commit -m "v${kscript_version} release"
git push #origin releases


## to test use `brew install holgerbrandl/tap/kscript`

0 comments on commit d36c2d9

Please sign in to comment.