Browse Source

configure headless build

master
Craig Raw 2 years ago
parent
commit
dbc1e7746b
  1. 14
      .github/workflows/package.yaml
  2. 10
      build.gradle

14
.github/workflows/package.yaml

@ -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/

10
build.gradle

@ -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/") {

Loading…
Cancel
Save