Skip to content

Commit 7dfbd9d

Browse files
Setup Homebrew release
1 parent 5cdd3d7 commit 7dfbd9d

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,49 @@ jobs:
1818
fileName: jjava-!(kernelspec)*@(.tar.gz|.whl)
1919
out-file-path: dist/
2020

21-
- name: Publish distributions to PyPI
21+
- name: Publish package to PyPI
2222
uses: pypa/gh-action-pypi-publish@release/v1
2323
with:
24-
verbose: true
24+
verbose: ${{ runner.debug }}
25+
26+
release-homebrew:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Publish package to Homebrew
31+
uses: m-dzianishchyts/brewtap@v1
32+
with:
33+
homebrew_owner: m-dzianishchyts
34+
homebrew_tap: homebrew-jjava
35+
version: ${{ github.ref_name }}
36+
depends_on: |
37+
"jupyterlab"
38+
"expect" => :test
39+
target: jjava-${{ github.ref_name }}-kernelspec.zip
40+
install: |
41+
libexec.install Dir["*.jar"]
42+
config = buildpath/"kernel.json"
43+
inreplace config, "{resource_dir}", libexec
44+
system "jupyter kernelspec install #{buildpath} --config=#{config} --sys-prefix --name=java"
45+
test: |
46+
jupyter = Formula["jupyterlab"].opt_bin/"jupyter"
47+
assert_match " java ", shell_output("#{jupyter} kernelspec list")
48+
49+
(testpath/"console.exp").write <<~EOS
50+
spawn #{jupyter} console --kernel=java
51+
expect -timeout 30 "In "
52+
send "System.out.println(\\\"Hello world!\\\");\r"
53+
expect -timeout 10 "In "
54+
send "\u0004"
55+
expect -timeout 10 "exit"
56+
send "y\r"
57+
EOS
58+
output = shell_output("expect -f console.exp")
59+
assert_match "JJava kernel #{version}", output
60+
assert_match "Hello world!", output
61+
caveats: |
62+
Although JJava doesn't depend on java, it requires jre>=11 to run.
63+
Make sure you have one in your PATH.
64+
update_readme_table: true
65+
github_token: ${{ secrets.HOMEBREW_REPO_ACCESS_TOKEN }}
66+
debug: ${{ runner.debug }}

0 commit comments

Comments
 (0)