Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/modules/ROOT/pages/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,23 @@ By default JBang downloads itself from GitHub. You can override the download URL
export JBANG_DOWNLOAD_URL=https://internal-mirror.example.com/jbang/jbang.tar
----

=== Downloading a specific version or the early-access build

Set `JBANG_DOWNLOAD_VERSION` to pick a specific release. Numeric values are resolved to the matching `vX.Y.Z` GitHub release; any other value is used as a release tag name as-is. This means you can opt-in to the perpetual early-access build with a simple:

[source,bash]
----
export JBANG_DOWNLOAD_VERSION=early-access
----

which resolves to https://github.com/jbangdev/jbang/releases/download/early-access/ . Equivalent forms:

[source,bash]
----
export JBANG_DOWNLOAD_VERSION=0.120.0 # -> .../download/v0.120.0/jbang.tar
export JBANG_DOWNLOAD_VERSION=early-access # -> .../download/early-access/jbang.tar
----

== Version Check

`jbang` will check once a day if a new version is available. If a new version is available a message will be printed with information on how to install.
Expand Down Expand Up @@ -504,7 +521,7 @@ These are read by the scripts themselves before Java or JBang's Java code is inv

| `JBANG_DOWNLOAD_VERSION`
| _(latest)_
| Specific JBang version to download (e.g., `0.120.0`). When unset, the latest release is used.
| Specific JBang version to download. Numeric values (e.g., `0.120.0`) are resolved to the matching `vX.Y.Z` GitHub release; any non-numeric value (e.g., `early-access`) is used as a release tag name as-is. When unset, the latest release is used.

| `JBANG_JAVA_OPTIONS`
| _(empty)_
Expand Down
24 changes: 24 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ project:
snapshot:
pattern: '^\d+\.\d+\.\d+\.\d+(?:-SNAPSHOT)?$'
label: early-access
fullChangelog: true

release:
github:
Expand All @@ -53,6 +54,29 @@ release:
formatted: always
preset: "conventional-commits"
format: '- {{commitShortHash}} {{commitTitle}}'
content: |
{{#Model.project.snapshot.enabled}}
WARNING: This is an early-access release directly from `main` branch, not intended for production use.

If you want to try the latest and greatest, please give it a spin and report any issues you find.

Here is how to install it:

Linux / macOS / WSL (bash):
```
curl -Ls https://sh.jbang.dev | JBANG_DOWNLOAD_VERSION=early-access bash -s - app setup
```

Windows PowerShell:
```
$env:JBANG_DOWNLOAD_VERSION='early-access'; iex "& { $(iwr -useb https://ps.jbang.dev) } app setup"
```
{{/Model.project.snapshot.enabled}}

## Changelog

{{changelogChanges}}
{{changelogContributors}}

checksum:
individual: true
Expand Down
8 changes: 7 additions & 1 deletion src/main/scripts/jbang
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,13 @@ if [[ -z "$binaryPath" && -z "$jarPath" ]]; then
elif [ -z "$JBANG_DOWNLOAD_VERSION" ]; then
jburl="${jbangDownloadBaseUrl}/latest/download/jbang.tar";
else
jburl="${jbangDownloadBaseUrl}/download/v$JBANG_DOWNLOAD_VERSION/jbang.tar";
# Numeric versions get a 'v' prefix (e.g. 0.120.0 -> v0.120.0); named
# release tags (e.g. 'early-access', '1.0.0-rc1') are used as-is.
case "$JBANG_DOWNLOAD_VERSION" in
*[!0-9.]*) jbtag="$JBANG_DOWNLOAD_VERSION" ;;
*) jbtag="v$JBANG_DOWNLOAD_VERSION" ;;
esac
Comment thread
maxandersen marked this conversation as resolved.
jburl="${jbangDownloadBaseUrl}/download/$jbtag/jbang.tar";
fi
echo "Downloading JBang ${JBANG_DOWNLOAD_VERSION:-latest} from $jburl..." 1>&2
download "$jburl" "$TDIR/urls/jbang.tar"
Expand Down
9 changes: 8 additions & 1 deletion src/main/scripts/jbang.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ if (-not $binaryPath -and -not $jarPath) {
} elseif (-not (Test-Path env:JBANG_DOWNLOAD_VERSION)) {
$jburl="$jbangDownloadBaseUrl/latest/download/jbang.zip"
} else {
$jburl="$jbangDownloadBaseUrl/download/v$env:JBANG_DOWNLOAD_VERSION/jbang.zip";
# Numeric versions get a 'v' prefix (e.g. 0.120.0 -> v0.120.0); named
# release tags (e.g. 'early-access', '1.0.0-rc1') are used as-is.
if ($env:JBANG_DOWNLOAD_VERSION -match '^[0-9]+(\.[0-9]+)*$') {
$jbtag = "v$env:JBANG_DOWNLOAD_VERSION"
} else {
$jbtag = $env:JBANG_DOWNLOAD_VERSION
}
$jburl="$jbangDownloadBaseUrl/download/$jbtag/jbang.zip";
}
$dlVersion = if ($env:JBANG_DOWNLOAD_VERSION) { $env:JBANG_DOWNLOAD_VERSION } else { 'latest' }
[Console]::Error.WriteLine("Downloading JBang $dlVersion from $jburl...")
Expand Down
Loading
Loading