Skip to content

Commit a5f3650

Browse files
authored
Merge pull request #105 from CodeDead/release/v1.2.0
Release/v1.2.0
2 parents f73dd58 + 5f1c324 commit a5f3650

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1124
-437
lines changed

.github/workflows/release.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
if: startsWith(github.ref, 'refs/tags/')
14+
strategy:
15+
matrix:
16+
os: [ ubuntu-latest, macos-latest, windows-latest ]
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Install dependencies
23+
if: ${{ matrix.os == 'ubuntu-latest' }}
24+
run: sudo apt-get install -y fuse libfuse2
25+
26+
- name: Set up JDK 20
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: '20.0.1'
30+
distribution: 'temurin'
31+
32+
- name: Build
33+
uses: gradle/gradle-build-action@v2
34+
with:
35+
arguments: build
36+
37+
- name: Build (jlink)
38+
uses: gradle/gradle-build-action@v2
39+
with:
40+
arguments: jlink
41+
42+
- name: Build (jpackage)
43+
uses: gradle/gradle-build-action@v2
44+
with:
45+
arguments: jpackage
46+
47+
- name: Publish artifacts
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
prerelease: false
51+
files: |
52+
build/jpackage/*
53+
env:
54+
GITHUB_TOKEN: ${{ github.token }}
55+
56+
build-portable:
57+
if: startsWith(github.ref, 'refs/tags/')
58+
strategy:
59+
matrix:
60+
os: [ ubuntu-latest, windows-latest ]
61+
runs-on: ${{ matrix.os }}
62+
steps:
63+
- uses: actions/checkout@v3
64+
65+
- name: Install dependencies
66+
if: ${{ matrix.os == 'ubuntu-latest' }}
67+
run: sudo apt-get install -y fuse libfuse2
68+
69+
- name: Set up JDK 20
70+
uses: actions/setup-java@v3
71+
with:
72+
java-version: '20.0.1'
73+
distribution: 'temurin'
74+
75+
- name: Switch portable flag (Linux)
76+
if: ${{ matrix.os == 'ubuntu-latest' }}
77+
run: sed -i 's/final boolean PORTABLE = false/final boolean PORTABLE = true/g' src/main/java/com/codedead/opal/utils/SharedVariables.java
78+
79+
- name: Switch portable flag (Windows)
80+
if: ${{ matrix.os == 'windows-latest' }}
81+
run: (Get-Content src\main\java\com\codedead\opal\utils\SharedVariables.java).replace('final boolean PORTABLE = false', 'final boolean PORTABLE = true') | Set-Content src\main\java\com\codedead\opal\utils\SharedVariables.java
82+
83+
- name: Build
84+
uses: gradle/gradle-build-action@v2
85+
with:
86+
arguments: build
87+
88+
- name: Build (AppImage)
89+
if: ${{ matrix.os == 'ubuntu-latest' }}
90+
uses: gradle/gradle-build-action@v2
91+
with:
92+
arguments: AppImage
93+
94+
- name: Build (jlink)
95+
uses: gradle/gradle-build-action@v2
96+
with:
97+
arguments: jlink
98+
99+
- name: Build (jpackage)
100+
uses: gradle/gradle-build-action@v2
101+
with:
102+
arguments: jpackage
103+
104+
- name: ZIP artifacts
105+
if: ${{ matrix.os == 'windows-latest' }}
106+
run: Compress-Archive -Path build/jpackage/Opal/* -Destination build/jpackage/Opal-win-portable.zip
107+
108+
- name: Publish artifacts
109+
uses: softprops/action-gh-release@v1
110+
with:
111+
prerelease: false
112+
files: |
113+
build/AppImage/*.AppImage
114+
build/jpackage/*.zip
115+
env:
116+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build:
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, macos-latest, windows-latest]
16+
os: [ ubuntu-latest, macos-latest, windows-latest ]
1717
runs-on: ${{ matrix.os }}
1818

1919
steps:
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up JDK 20
2727
uses: actions/setup-java@v3
2828
with:
29-
java-version: '20'
29+
java-version: '20.0.1'
3030
distribution: 'temurin'
3131

3232
- name: Test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ logs/*
3939
/default.properties
4040
/help.pdf
4141
.opal/
42+
.com.codedead.opal/

README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can create an executable installer by running the `jpackage` Gradle task on
1919
```shell
2020
./gradlew jpackage
2121
```
22-
*Do note that you will need the [WiX Toolset](https://wixtoolset.org/) in order to create MSI packages.*
22+
*Do note that you will need the [WiX Toolset](https://wixtoolset.org/) in order to create `msi` packages.*
2323

2424
#### Portable image
2525

@@ -32,19 +32,19 @@ You can create a portable image by running the `jpackageImage` Gradle task on a
3232

3333
#### rpm
3434

35-
You can create an RPM, by running the `jpackage` Gradle task on a Linux host:
35+
You can create an `rpm`, by running the `jpackage` Gradle task on a Linux host:
3636
```shell
3737
./gradlew jpackage
3838
```
39-
*Do note that you will need the `rpm-build` package in order to create an RPM.*
39+
*Do note that you will need the `rpm-build` package in order to create an `rpm`.*
4040

4141
#### AppImage
4242

4343
You can create an [AppImage](https://appimage.github.io/) by executing the `AppImage` Gradle task on a Linux host:
4444
```shell
4545
./gradlew AppImage
4646
```
47-
*Do note that running this task will execute a shell script in order to download and run the [appimagetool](https://appimage.github.io/appimagetool/) in order to create the AppImage file.*
47+
*Do note that running this task will execute a shell script in order to download and run the [appimagetool](https://appimage.github.io/appimagetool/) in order to create the `AppImage` file.*
4848

4949
#### Portable image
5050

@@ -53,6 +53,22 @@ You can create a portable image by running the `jpackageImage` Gradle task on a
5353
./gradlew jpackageImage
5454
```
5555

56+
### macOS
57+
58+
#### dmg
59+
60+
You can create a `dmg`, by running the `jpackage` Gradle task on a macOS host:
61+
```shell
62+
./gradlew jpackage
63+
```
64+
65+
#### Portable image
66+
67+
You can create a portable image by running the `jpackageImage` Gradle task on a macOS host:
68+
```shell
69+
./gradlew jpackageImage
70+
```
71+
5672
## Dependencies
5773

5874
A couple of dependencies are required in order to build Opal. Some of which require a specific host machine,

build.gradle

+40-23
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ plugins {
66
id 'eclipse'
77
id 'application'
88
id 'org.beryx.jlink' version '2.26.0'
9+
id 'org.openjfx.javafxplugin' version '0.0.14'
910
}
1011

1112
group 'com.codedead'
12-
version '1.1.0'
13+
version '1.2.0'
1314

1415
def currentOS = DefaultNativePlatform.currentOperatingSystem
1516

@@ -23,6 +24,12 @@ application {
2324
mainClass = 'com.codedead.opal.OpalApplication'
2425
}
2526

27+
javafx {
28+
version = '20.0.1'
29+
configuration = 'implementation'
30+
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.media']
31+
}
32+
2633
jlink {
2734
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
2835
forceMerge('log4j-api', 'jackson')
@@ -46,12 +53,16 @@ jlink {
4653
installerOptions = [
4754
'--win-menu',
4855
'--win-menu-group', 'CodeDead',
49-
'--win-shortcut',
56+
'--win-shortcut-prompt',
57+
'--win-upgrade-uuid', '876c5464-9a66-4913-89a4-c63a4b8b4bb9',
58+
'--win-help-url', 'https://codedead.com/contact',
5059
'--win-dir-chooser',
5160
'--copyright', 'Copyright (c) 2023 CodeDead',
5261
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
5362
'--vendor', 'CodeDead',
54-
'--license-file', 'LICENSE'
63+
'--license-file', 'LICENSE',
64+
'--app-version', "${project.version.toString()}",
65+
'--about-url', 'https://codedead.com'
5566
]
5667
}
5768
} else if (currentOS.isLinux()) {
@@ -65,7 +76,25 @@ jlink {
6576
'--copyright', 'Copyright (c) 2023 CodeDead',
6677
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
6778
'--vendor', 'CodeDead',
68-
'--license-file', 'LICENSE'
79+
'--license-file', 'LICENSE',
80+
'--app-version', "${project.version.toString()}",
81+
'--about-url', 'https://codedead.com'
82+
]
83+
}
84+
} else if (currentOS.isMacOsX()) {
85+
jpackage {
86+
installerType = 'dmg'
87+
icon = "${project.rootDir}/src/main/resources/images/opal.png"
88+
installerOptions = [
89+
'--mac-package-name', 'Opal',
90+
'--mac-package-identifier', 'com.codedead.opal',
91+
'--mac-app-category', 'public.app-category.music',
92+
'--copyright', 'Copyright (c) 2023 CodeDead',
93+
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
94+
'--vendor', 'CodeDead',
95+
'--license-file', 'LICENSE',
96+
'--app-version', "${project.version.toString()}",
97+
'--about-url', 'https://codedead.com'
6998
]
7099
}
71100
}
@@ -98,38 +127,26 @@ configure(AppImage) {
98127
description = 'Create an AppImage after creating the image of the application'
99128
}
100129

130+
def homeConfig = System.properties['user.home'] + '/.config/com.codedead.opal'
101131
clean.doFirst {
102132
delete 'default.properties'
103133
delete 'license.pdf'
104134
delete 'help.pdf'
105135
delete 'logs'
106-
delete '.opal'
136+
delete '.com.codedead.opal'
137+
delete "$homeConfig"
107138
}
108139

109140
repositories {
110141
mavenCentral()
111142
}
112143

113-
def platform
114-
if (currentOS.isWindows()) {
115-
platform = 'win'
116-
} else if (currentOS.isLinux()) {
117-
platform = 'linux'
118-
} else if (currentOS.isMacOsX()) {
119-
platform = 'mac'
120-
}
121-
122144
dependencies {
123-
implementation "org.openjfx:javafx-base:20:${platform}"
124-
implementation "org.openjfx:javafx-controls:20:${platform}"
125-
implementation "org.openjfx:javafx-graphics:20:${platform}"
126-
implementation "org.openjfx:javafx-fxml:20:${platform}"
127-
implementation "org.openjfx:javafx-media:20:${platform}"
128145
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
129-
implementation 'io.github.mkpaz:atlantafx-base:1.2.0'
130-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
131-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
132-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
146+
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
147+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
148+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
149+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
133150
}
134151

135152
tasks.named('test') {

gradle/wrapper/gradle-wrapper.jar

1.27 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.1-20230330100852+0000-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+4-1
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ location of your Java installation."
130130
fi
131131
else
132132
JAVACMD=java
133-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134136
135137
Please set the JAVA_HOME variable in your environment to match the
136138
location of your Java installation."
139+
fi
137140
fi
138141

139142
# Increase the maximum file descriptors if we can.

0 commit comments

Comments
 (0)