-
Notifications
You must be signed in to change notification settings - Fork 45
JReleaser
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.
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. Needed repos are:
-
spring-cli
: clone repo -
homebrew-spring-cli
: create empty uninitialised repo
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.
-
Install JReleaser from https://github.com/jreleaser/jreleaser/releases
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>
If current version is 0.7.1-SNAPSHOT
, run snapshot release.
JRELEASER_PROJECT_VERSION=0.7.1-SNAPSHOT jreleaser assemble \
--select-current-platform
JRELEASER_PROJECT_VERSION=0.7.1-SNAPSHOT jreleaser full-release \
--select-current-platform \
--dry-run
If you want to try GA release, change project version, build it
and then you can use JRELEASER_PROJECT_VERSION=0.7.1.
If you don’t use --dry-run
option you should see GA release
in your repo.
PAT you’ve created needs to go in into repository secret as
JRELEASER_GITHUB_TOKEN
. Then you can run snapshot or release
builds from any branch.
For Windows https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ provides good images for getting vm’s up and running quickly. For MacOS https://github.com/myspaghetti/macos-virtualbox has a nice way to setup vm on a Linux.
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)"
Install spring-cli(brew tap would be under your or official repo):
brew tap jvalkeal/spring-cli
brew install spring-cli
You should have spring
command.