Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

JReleaser

Janne Valkealahti edited this page Sep 27, 2023 · 4 revisions

This page contains info about JReleaser we use during a build. JReleaser is used for both snapshots are releases. Main difference is that as JReleaser is meant for a production tool it will skip some publishing parts for snapshots.

Running Locally

We don’t do releases locally but sometimes it’s convenient to try things out in your own system. Maybe you’re just trying things out or preparing to modify JReleaser scripts.

Create GitHub PAT

Use fine grained PAT to give access only to your own repos, then you’re not messing up anything in production. Needed permissions in fine grained PAT is read/write with Contents. With fine grained PAT only add target repos in your own account/org.

Prepare to Run JReleaser

JReleaser expects some things to exist, so run a build and setup jdks.

./gradlew build -x test
./gradlew -PcliRelease=true setupJdks
export JRELEASER_GITHUB_TOKEN=<PAT>

Homebrew

Create Brew Repository

JReleaser will not publish snapshots to brew repo so you need to build non-snapshot version locally.

Testing

We’re running in a container which can be thrown away. Prepare a container:

docker run --name jr-ubuntu-1804-brew -d -t ubuntu:18.04
docker exec -it jr-ubuntu-1804-brew bash

apt update
apt install -y git curl gcc

Install brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /root/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
Clone this wiki locally