An open API service indexing awesome lists of open source software.

https://github.com/jbangdev/setup-jbang

Setup JBang cli to use in GitHub Actions
https://github.com/jbangdev/setup-jbang

Last synced: 19 days ago
JSON representation

Setup JBang cli to use in GitHub Actions

Awesome Lists containing this project

README

          

= setup-jbang
:linkattrs:
:project-owner: jbangdev
:project-name: setup-jbang

image:https://github.com/{project-owner}/{project-name}/workflows/Test/badge.svg["Build Status", link="https://github.com/{project-owner}/{project-name}/actions"]
image:https://img.shields.io/github/v/release/{project-owner}/{project-name}["GitHub release", link="https://github.com/jreleaser/release-action/releases"]
image:https://img.shields.io/twitter/follow/{project-owner}?style=social["Twitter Follow", link="https://twitter.com/jreleaser"]

This action setup link:https://jbang.dev[JBang] cli for GitHub Actions.

This is recommended over using the container image based `jbangdev/jbang-action` which is slower. `setup-java` is faster and "just works" in comparison.

== Usage

=== Workflow

[source,yaml]
----
name: jbang

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Configure build steps as you'd normally do

- name: Setup JBang
uses: jbangdev/setup-jbang@main

- name: properties
run: |
jbang properties@jbangdev

----

IMPORTANT: This action will download a suitable Java runtime automatically if one is not available. Thus this action does not need a pre-configured Java setup. The action and JBang will though prefer to use a JDK if it is available. GitHub runners have a default Java 11 available thus it will use that Java by default. If you would like to use a different Java version/distribution, then add a `actions/setup-java` as needed. Example:

[source,yaml]
----
name: jbang

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Configure build steps as you'd normally do

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: |
11
17

- name: Setup JBang
uses: jbangdev/setup-jbang@main

- name: Configure java
run: |
jbang jdk install 11 ${{env.JAVA_HOME_11_X64}}
jbang jdk install 17 ${{env.JAVA_HOME_17_X64}}

- name: complexhelloworld
run: |
jbang properties@jbangdev java.vendor.version # uses the default java version

- name: test output 11
run: jbang --java 11 properties@jbangdev java.vendor.version # use java 11
- name: test output 17
run: jbang --java 17 properties@jbangdev java.vendor.version # use java 17




----

== Customizing

== Inputs

Following inputs can be used as `step.with` keys

[%header,cols="<2,<,<2,<3",width="100%"]
|===
| Name | Type | Default | Description
| version | String | | The JBang version to use. +
Should match any of the link:https://github.com/jbangdev/jbang/releases[published releases]. Leave empty to use the latest.
|===