-
Notifications
You must be signed in to change notification settings - Fork 2
160 lines (144 loc) · 5.74 KB
/
build.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
JAVA_RELEASE: '23'
JAVA_VERSION: '23.0.1'
JAVAFX_VERSION: '23.0.1'
APP_VERSION: '1.0.0'
jobs:
build:
strategy:
matrix:
os: [ macos-13, macos-14, ubuntu-latest, windows-latest ]
include:
- os: macos-13
ARCH: "-amd64"
PLAT: "macos"
FX: "osx-x64"
- os: macos-14
ARCH: "-aarch64"
PLAT: "macos"
FX: "osx-aarch64"
- os: ubuntu-latest
ARCH: ""
PLAT: "linux"
FX: "linux-x64"
- os: windows-latest
ARCH: ""
PLAT: "win"
FX: "windows-x64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: oracle-actions/[email protected]
with:
website: jdk.java.net
release: ${{ env.JAVA_RELEASE }}
version: ${{ env.JAVA_VERSION }}
- uses: Apple-Actions/import-codesign-certs@v3
if: github.event_name != 'pull_request' && (matrix.os == 'macos-13' || matrix.os == 'macos-14')
with:
p12-file-base64: ${{ secrets.CERTIFICATES_FILE_BASE64 }}
p12-password: ${{ secrets.CERTIFICATES_PASSWORD }}
- name: Cache Maven packages
uses: actions/cache@v4
if: false # while using snapshots
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and package Jar (non-windows)
if: matrix.os != 'windows-latest'
run: mvn -B -ntp -q clean package -Dmaven.test.skip=true
- name: Build and package Jar (windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: call mvn -B -ntp package -Dmaven.test.skip=true
- name: Create Bundle using jpackage for macos
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
id: outputfile_mac
run: |
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
.github/scripts/jpackage.sh \
--type dmg \
--mac-package-identifier com.gluonhq.scenebuilder.embedded.Demo \
--mac-package-name 'Embedded SB Demo' \
--mac-package-signing-prefix "${{ env.MACSIGN_PREFIX }}" \
--mac-signing-key-user-name "${{ env.MACSIGN_USER }}" \
--mac-sign
else
.github/scripts/jpackage.sh \
--type dmg \
--mac-package-identifier com.gluonhq.scenebuilder.embedded.Demo \
--mac-package-name 'Embedded SB Demo'
fi
mv target/installer/EmbeddedSceneBuilderDemo-${{ env.APP_VERSION }}.dmg target/installer/EmbeddedSceneBuilderDemo-${{ env.APP_VERSION }}${{ matrix.ARCH }}.dmg
echo path=target/installer/EmbeddedSceneBuilderDemo-${{ env.APP_VERSION }}${{ matrix.ARCH }}.dmg >> $GITHUB_OUTPUT
env:
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
MACSIGN_PREFIX: ${{ secrets.GLUON_MACSIGN_PREFIX }}
MACSIGN_USER: ${{ secrets.GLUON_MACSIGN_USER }}
APP_VERSION: ${{ env.APP_VERSION }}
- name: Create Bundle using jpackage for linux
if: matrix.os == 'ubuntu-latest'
id: outputfile_linux
run: |
.github/scripts/jpackage.sh \
--type deb
echo path_deb=target/installer/embeddedscenebuilderdemo_${{ env.APP_VERSION }}_amd64.deb >> $GITHUB_OUTPUT
.github/scripts/jpackage.sh \
--type rpm
ls -l target/installer/
echo path_rpm=target/installer/embeddedscenebuilderdemo-${{ env.APP_VERSION }}-1.x86_64.rpm >> $GITHUB_OUTPUT
env:
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
APP_VERSION: ${{ env.APP_VERSION }}
- name: Create Bundle using jpackage for windows
if: matrix.os == 'windows-latest'
id: outputfile_win
shell: cmd
run: |
call .github\scripts\jpackage.bat
echo path=target\installer\EmbeddedSceneBuilderDemo-${{ env.APP_VERSION }}.msi >> %GITHUB_OUTPUT%
env:
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
APP_VERSION: ${{ env.APP_VERSION }}
- name: Notarize Release Build
if: github.event_name != 'pull_request' && (matrix.os == 'macos-13' || matrix.os == 'macos-14')
uses: erwin1/xcode-notarizer@v1
with:
product-path: ${{ steps.outputfile_mac.outputs.path }}
apple-id: ${{ secrets.NOTARIZATION_USERNAME }}
app-password: ${{ secrets.NOTARIZATION_PASSWORD }}
team-id: ${{ secrets.GLUON_MACSIGN_PREFIX }}
- name: Archive jpackage for macos
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: EmbeddedSceneBuilderDemo-${{ matrix.PLAT }}${{ matrix.ARCH }}
path: ${{ steps.outputfile_mac.outputs.path }}
- name: Archive jpackage for linux deb
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: EmbeddedSceneBuilderDemo-${{ matrix.PLAT }}${{ matrix.ARCH }}-deb
path: ${{ steps.outputfile_linux.outputs.path_deb }}
- name: Archive jpackage for linux rpm
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: EmbeddedSceneBuilderDemo-${{ matrix.PLAT }}${{ matrix.ARCH }}-rpm
path: ${{ steps.outputfile_linux.outputs.path_rpm }}
- name: Archive jpackage for windows
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: EmbeddedSceneBuilderDemo-${{ matrix.PLAT }}${{ matrix.ARCH }}
path: ${{ steps.outputfile_win.outputs.path }}