configure headless build

This commit is contained in:
Craig Raw 2022-10-25 10:04:03 +02:00
parent 9325a1968b
commit dbc1e7746b
2 changed files with 21 additions and 3 deletions

View file

@ -40,3 +40,17 @@ jobs:
path: |
build/jpackage/*
!build/jpackage/Sparrow/
- name: Headless build with Gradle
if: ${{ runner.os == 'Linux' }}
run: ./gradlew -Djava.awt.headless=true clean jpackage
- name: Package headless tar distribution
if: ${{ runner.os == 'Linux' }}
run: ./gradlew packageTarDistribution
- name: Upload Headless Artifact
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v2
with:
name: Sparrow Build - ${{ runner.os }} Headless
path: |
build/jpackage/*
!build/jpackage/Sparrow/

View file

@ -20,6 +20,10 @@ if(System.getProperty("os.arch") == "aarch64") {
targetName = "-" + osArch
}
def headless = "true".equals(System.getProperty("java.awt.headless")) || GraphicsEnvironment.isHeadless()
def sparrowBuild = ""
if(headless) {
sparrowBuild = "Server"
}
group "com.sparrowwallet"
version "${sparrowVersion}"
@ -224,7 +228,7 @@ jlink {
addExtraDependencies("javafx")
jpackage {
imageName = "Sparrow"
installerName = "Sparrow"
installerName = "Sparrow${sparrowBuild}"
appVersion = "${sparrowVersion}"
skipInstaller = os.macOsX || properties.skipInstallers
imageOptions = []
@ -251,7 +255,7 @@ task removeGroupWritePermission(type: Exec) {
}
task packageZipDistribution(type: Zip) {
archiveFileName = "Sparrow-${sparrowVersion}.zip"
archiveFileName = "Sparrow${sparrowBuild}-${sparrowVersion}.zip"
destinationDirectory = file("$buildDir/jpackage")
from("$buildDir/jpackage/") {
include "Sparrow/**"
@ -261,7 +265,7 @@ task packageZipDistribution(type: Zip) {
task packageTarDistribution(type: Tar) {
dependsOn removeGroupWritePermission
archiveFileName = "sparrow-${sparrowVersion}.tar.gz"
archiveFileName = "sparrow${sparrowBuild.toLowerCase()}-${sparrowVersion}.tar.gz"
destinationDirectory = file("$buildDir/jpackage")
compression = Compression.GZIP
from("$buildDir/jpackage/") {