Skip to content

Commit

Permalink
add jpackage installer options
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Apr 25, 2023
1 parent 61241bf commit bfd2b84
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/actions/gradle-and-sha/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
arguments: ${{ inputs.gradle-command }}
- name: "Rename zip file"
shell: bash
run: mv ${{ inputs.intermediate-filepath }} ${{ inputs.final-filepath }}
run: ls build/jpackage & mv ${{ inputs.intermediate-filepath }} ${{ inputs.final-filepath }}

- name: "Generate SHA512 for Linux"
shell: bash
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
types: [published]
push:
branches:
- 'master'
- 'develop'
- 'feature/issue-57_standalone-executable'

jobs:
Expand Down Expand Up @@ -44,12 +42,13 @@ jobs:
id: jpackagefn
shell: bash
run: |
# TODO sync version number with Main.java and build.gradle
if [ ${{ runner.os }} == 'Windows' ]; then
echo "FILEPATH=build/jpackage/rcv-1.0.exe" >> $GITHUB_OUTPUT
echo "FILEPATH=build/jpackage/RCTab-1.3.1.exe" >> $GITHUB_OUTPUT
elif [ ${{ runner.os }} == 'Linux' ]; then
echo "FILEPATH=build/jpackage/rcv/bin/rcv" >> $GITHUB_OUTPUT
echo "FILEPATH=build/jpackage/rctab_1.3.1-1_amd64.deb" >> $GITHUB_OUTPUT
else
echo "FILEPATH=build/jpackage/rcv-1.0.dmg" >> $GITHUB_OUTPUT
echo "FILEPATH=build/jpackage/RCTab-1.3.1.dmg" >> $GITHUB_OUTPUT
fi
- name: "Create executable filename"
id: exefn
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Build, Lint, and Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Test with Gradle
run: ./gradlew check
21 changes: 17 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,32 @@ javafx {

def JLINK_DIR = "$buildDir/rcv"
// Necessary to explicitly include due to https://github.com/BrightSpots/rcv/issues/625
def MODULES_TO_ADD = "com.ctc.wstx"
def MODULE_TO_ADD = "com.ctc.wstx"

// ### jlink plugin settings
jlink {
imageDir = file(JLINK_DIR)
imageZip = file(JLINK_DIR + ".zip")
addOptions '--add-modules', MODULES_TO_ADD, '--strip-debug', '--compress', '2',
'--no-header-files', '--no-man-pages'
addOptions '--add-modules', MODULE_TO_ADD,
'--strip-debug', '--compress', '2',
'--no-header-files', '--no-man-pages'
mergedModule {
requires "java.xml"
}
launcher {
name = "rcv"
// TODO sync these values with Main.java
name = "RCTab"
version = "1.3.1"
}

jpackage {
installerOptions += [
'--verbose',
'--vendor', 'The Ranked Choice Voting Resource Center'
]
if (org.gradle.internal.os.OperatingSystem.current().windows) {
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/network/brightspots/rcv/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@SuppressWarnings("WeakerAccess")
public class Main extends GuiApplication {

// TODO - sync these values with build.gradle
public static final String APP_NAME = "RCTab";
public static final String APP_VERSION = "1.3.1";

Expand Down

0 comments on commit bfd2b84

Please sign in to comment.