forked from gluonhq/scenebuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (94 loc) · 3.55 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
name: Linux Bundles
on:
workflow_call:
inputs:
app-version:
required: true
type: string
project-version:
required: true
type: string
java-version:
default: '21.0.1'
required: false
type: string
javafx-version:
default: '21.0.1'
required: false
type: string
test:
default: false
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install packages
run: sudo apt-get install xdg-utils
- uses: actions/checkout@v2
- name: Setup Java
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ inputs.java-version }}
- name: Setup JavaFX
run: |
wget -P /tmp https://download2.gluonhq.com/openjfx/${{ inputs.javafx-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@v2
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 '"--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-${{ inputs.javafx-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@v2
with:
name: artifacts
path: |
app/target/install/*.deb
app/target/install/*.rpm