-
Notifications
You must be signed in to change notification settings - Fork 221
119 lines (108 loc) · 4.13 KB
/
bundles-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Linux Bundles
on:
workflow_call:
inputs:
app-version:
required: true
type: string
project-version:
required: true
type: string
java-release:
default: '23'
required: false
type: string
java-version:
default: '23.0.1'
required: false
type: string
javafx-version:
default: '23.0.1'
required: false
type: string
test:
default: false
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Install packages
run: sudo apt-get install xdg-utils
- uses: actions/checkout@v4
- name: Setup Java
uses: oracle-actions/[email protected]
with:
website: jdk.java.net
release: ${{ inputs.java-release }}
version: ${{ inputs.java-version }}
- name: Setup JavaFX
id: javafx
run: |
JAVAFX_MAJOR_VERSION=$(echo ${{ inputs.javafx-version }} | cut -d- -f1)
echo JAVAFX_MAJOR_VERSION=$JAVAFX_MAJOR_VERSION >> $GITHUB_OUTPUT
wget -P /tmp https://download2.gluonhq.com/openjfx/$JAVAFX_MAJOR_VERSION/openjfx-${{ inputs.javafx-version }}_linux-x64_bin-jmods.zip
unzip /tmp/openjfx-${{ inputs.javafx-version }}_linux-x64_bin-jmods.zip -d /tmp
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run Tests
if: ${{ inputs.test }}
run: |
export DISPLAY=:90
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
mvn -B -ntp clean verify checkstyle:checkstyle --no-transfer-progress
- name: Build and package JAR
run: |
mvn -B -ntp -q versions:set -DnewVersion=${{ env.APP_VERSION }} -DgenerateBackupPoms=false
mvn -B -ntp -q clean package -Dmaven.test.skip=true -X
env:
APP_VERSION: ${{ inputs.app-version }}
- name: Create Bundle using JPackage
run: |
# Create DEB
.github/scripts/jpackage.sh \
--icon app/assets/linux/icon-linux.png \
--java-options '"-Djdk.gtk.version=2"' \
--java-options '"-Djavafx.allowjs=true"' \
--java-options '"--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED"' \
--java-options '"-Djava.library.path=/opt/scenebuilder/lib/runtime/bin:/opt/scenebuilder/lib/runtime/lib"' \
--linux-menu-group '"Development;Building;GUIDesigner;Java;"' \
--resource-dir app/assets/linux \
--install-dir /opt \
--type deb
mv ${{ env.INSTALL_DIR }}/*.deb ${{ env.INSTALL_DIR }}/SceneBuilder-${{ env.PROJECT_VERSION }}.deb
# Create RPM
.github/scripts/jpackage.sh \
--icon app/assets/linux/icon-linux.png \
--java-options '"-Djdk.gtk.version=2"' \
--java-options '"--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED"' \
--linux-menu-group '"Development;Building;GUIDesigner;Java;"' \
--resource-dir app/assets/linux \
--install-dir /opt \
--type rpm
mv ${{ env.INSTALL_DIR }}/*.rpm ${{ env.INSTALL_DIR }}/SceneBuilder-${{ env.PROJECT_VERSION }}.rpm
ls ${{ env.INSTALL_DIR }}
env:
MAIN_CLASS: com.oracle.javafx.scenebuilder.app.SceneBuilderApp
JAVAFX_HOME: /tmp/javafx-jmods-${{ steps.javafx.outputs.JAVAFX_MAJOR_VERSION }}/
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
PROJECT_VERSION: ${{ inputs.project-version }}
APP_VERSION: ${{ inputs.app-version }}
INSTALL_DIR: app/target/install
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-${{ inputs.project-version }}.deb
path: |
app/target/install/*.deb
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-${{ inputs.project-version }}.rpm
path: |
app/target/install/*.rpm