1.0-a4 #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'release packages' | |
on: | |
release: | |
types: [published] | |
jobs: | |
release-pypi: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download release assets | |
uses: robinraju/release-downloader@v1 | |
with: | |
tag: ${{ github.ref_name }} | |
fileName: jjava-!(kernelspec)*@(.tar.gz|.whl) | |
out-file-path: dist/ | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: ${{ runner.debug }} | |
release-homebrew: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish package to Homebrew | |
uses: m-dzianishchyts/brewtap@v1 | |
with: | |
homebrew_owner: dflib | |
homebrew_tap: homebrew-tap | |
version: ${{ github.ref_name }} | |
depends_on: | | |
"jupyterlab" | |
"expect" => :test | |
target: jjava-${{ github.ref_name }}-kernelspec.zip | |
install: | | |
libexec.install Dir["*.jar"] | |
config = buildpath/"kernel.json" | |
inreplace config, "{resource_dir}", libexec | |
system "jupyter kernelspec install #{buildpath} --config=#{config} --sys-prefix --name=java" | |
test: | | |
jupyter = Formula["jupyterlab"].opt_bin/"jupyter" | |
assert_match " java ", shell_output("#{jupyter} kernelspec list") | |
(testpath/"console.exp").write <<~EOS | |
spawn #{jupyter} console --kernel=java | |
expect -timeout 30 "In " | |
send "System.out.println(\\\"Hello world!\\\");\r" | |
expect -timeout 10 "In " | |
send "\u0004" | |
expect -timeout 10 "exit" | |
send "y\r" | |
EOS | |
output = shell_output("expect -f console.exp") | |
assert_match "JJava kernel #{version}", output | |
assert_match "Hello world!", output | |
caveats: | | |
Although JJava doesn't depend on java, it requires jre>=11 to run. | |
Make sure you have one in your PATH. | |
update_readme_table: true | |
github_token: ${{ secrets.HOMEBREW_RELEASE_ACCESS_TOKEN }} | |
debug: ${{ runner.debug }} |