-
Notifications
You must be signed in to change notification settings - Fork 6
256 lines (249 loc) · 8.66 KB
/
package.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: Package
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master ]
env:
JPACKAGE_COMMON_OPTS: |
--name radiorecorder \
--copyright "Stephan Fuhrmann" \
--vendor "Stephan Fuhrmann" \
--description "Records and plays internet radio streams" \
--main-class de.sfuhrm.radiorecorder.Main \
--dest jpackage-app \
--verbose
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 21
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract current maven version
run: echo "version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
id: version
shell: bash
- uses: actions/upload-artifact@v3
with:
name: packages
path: target/radiorecorder-${{ steps.version.outputs.version }}-bin.tar.gz
- uses: actions/upload-artifact@v3
with:
name: packages
path: target/radiorecorder-${{ steps.version.outputs.version }}-bin.tar.bz2
- uses: actions/upload-artifact@v3
with:
name: packages
path: target/radiorecorder-${{ steps.version.outputs.version }}-bin.zip
- uses: actions/upload-artifact@v3
with:
name: build
path: target/radiorecorder-${{ steps.version.outputs.version }}-app
jpackage_linux:
needs: build
outputs:
packagename: ${{ steps.packagename.outputs.packagename }}
strategy:
matrix:
include:
- os: ubuntu-latest
container: debian:10
jpkg_type: deb
style: debian
- os: ubuntu-latest
container: oraclelinux:8.5
jpkg_type: rpm
style: redhat
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
PACKAGE_VERSION: ${{ needs.build.outputs.version }}
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
- name: Setup Debian container
run: |
echo "List of current dir:"
ls -alR
echo "Debian version:"
cat /etc/debian_version
apt-get update
apt-get install -y --no-install-recommends curl openssh-client git fakeroot curl binutils
if: matrix.style == 'debian'
- name: Setup OracleLinux container
run: |
echo "List of current dir:"
ls -alR
yum install --assumeyes rpm-build git openssh-clients
if: matrix.style == 'redhat'
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Build package
run: |
if test "${{ matrix.style }}" = "redhat"; then
PACKAGE_VERSION=$(echo ${PACKAGE_VERSION} | cut -d"-" -f1)
echo "Fixing RPM version to ${PACKAGE_VERSION}"
fi
APPDIR=$(pwd)/radiorecorder-${{ needs.build.outputs.version }}
jpackage \
--main-jar lib/radiorecorder-${{ needs.build.outputs.version }}.jar \
--type ${{ matrix.jpkg_type }} \
--app-version ${PACKAGE_VERSION} \
--input ${APPDIR} \
--license-file ${APPDIR}/LICENSE \
--linux-deb-maintainer [email protected] \
--linux-app-category sound \
--install-dir /usr \
${{ env.JPACKAGE_COMMON_OPTS }}
- name: Extract package name
run: echo "packagename=$(ls)" >> $GITHUB_OUTPUT
working-directory: jpackage-app
id: packagename
shell: bash
- name: Test install package Debian
run: apt-get install --assume-yes ./jpackage-app/${{ steps.packagename.outputs.packagename }}
if: matrix.style == 'debian'
- name: Test install package RPM
run: yum localinstall --assumeyes ./jpackage-app/${{ steps.packagename.outputs.packagename }}
if: matrix.style == 'redhat'
- name: Test run application
run: radiorecorder -V
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.jpkg_type }}
path: jpackage-app/${{ steps.packagename.outputs.packagename }}
- uses: actions/upload-artifact@v3
with:
name: packages
path: jpackage-app/${{ steps.packagename.outputs.packagename }}
jpackage_macos:
needs: build
outputs:
packagename: ${{ steps.packagename.outputs.packagename }}
strategy:
matrix:
include:
- jpkg_type: dmg
- jpkg_type: pkg
runs-on: macos-latest
env:
PACKAGE_VERSION: ${{ needs.build.outputs.version }}
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Build package
run: |
APPDIR=$(pwd)/radiorecorder-${{ needs.build.outputs.version }}
PACKAGE_VERSION=$(echo ${PACKAGE_VERSION} | cut -d"-" -f1)
jpackage \
--main-jar lib/radiorecorder-${{ needs.build.outputs.version }}.jar \
--type ${{ matrix.jpkg_type }} \
--app-version ${PACKAGE_VERSION} \
--input ${APPDIR} \
--license-file ${APPDIR}/LICENSE \
--install-dir /Applications \
${{ env.JPACKAGE_COMMON_OPTS }}
- name: Extract package name
run: echo "packagename=$(ls)" >> $GITHUB_OUTPUT
working-directory: jpackage-app
id: packagename
shell: bash
- name: Test install package MacOS PKG
run: sudo installer -verbose -pkg ./jpackage-app/${{ steps.packagename.outputs.packagename }} -target /
if: matrix.jpkg_type == 'pkg'
- name: Test run application
run: ./radiorecorder -V
working-directory: /Applications/radiorecorder.app/Contents/MacOS
if: matrix.jpkg_type == 'pkg'
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.jpkg_type }}
path: jpackage-app/${{ steps.packagename.outputs.packagename }}
- uses: actions/upload-artifact@v3
with:
name: packages
path: jpackage-app/${{ steps.packagename.outputs.packagename }}
jpackage_windows:
needs: build
outputs:
packagename: ${{ steps.packagename.outputs.packagename }}
strategy:
matrix:
include:
- jpkg_type: exe
- jpkg_type: msi
runs-on: windows-latest
env:
PACKAGE_VERSION: ${{ needs.build.outputs.version }}
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Build package
run: |
APPDIR=$(pwd)/radiorecorder-${{ needs.build.outputs.version }}
PACKAGE_VERSION=$(echo ${PACKAGE_VERSION} | cut -d"-" -f1)
jpackage \
--main-jar lib/radiorecorder-${{ needs.build.outputs.version }}.jar \
--type ${{ matrix.jpkg_type }} \
--app-version ${PACKAGE_VERSION} \
--input ${APPDIR} \
--license-file ${APPDIR}/LICENSE \
--win-console \
--win-upgrade-uuid a32f7c72-87d5-44ab-91b6-1f4e13fea46b \
${{ env.JPACKAGE_COMMON_OPTS }}
shell: bash
- name: Extract package name
run: echo "packagename=$(ls)" >> $GITHUB_OUTPUT
working-directory: jpackage-app
id: packagename
shell: bash
- name: Test install package Windows MSI
run: msiexec /quiet /passive /i ${{ steps.packagename.outputs.packagename }}
working-directory: jpackage-app
if: matrix.jpkg_type == 'msi'
- name: dir
run: ls
working-directory: "C:\\Program Files\\radiorecorder"
shell: bash
if: matrix.jpkg_type == 'msi'
- name: Test run application
run: ./radiorecorder -V
working-directory: "C:\\Program Files\\radiorecorder"
shell: bash
if: matrix.jpkg_type == 'msi'
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.jpkg_type }}
path: jpackage-app/${{ steps.packagename.outputs.packagename }}
- uses: actions/upload-artifact@v3
with:
name: packages
path: jpackage-app/${{ steps.packagename.outputs.packagename }}