-
Notifications
You must be signed in to change notification settings - Fork 6
151 lines (134 loc) · 5.78 KB
/
Copy pathlinux-deb.yml
File metadata and controls
151 lines (134 loc) · 5.78 KB
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
name: Linux DEB Build
on:
push:
branches: [ "dev", "release/**" ]
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
pull_request:
branches: [ "**" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
# --- LINUX DEBIAN FAT BUILD (jpackage, bundled JRE) ---
# Builds once on ubuntu-22.04 (older LTS = wider install compatibility).
build-deb-fat:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Fetch bundled smartctl from jdm-deps
# Downloads the pre-packaged smartctl 7.5 binary from the public
# JDiskMark/jdm-deps release asset. The staging directory is picked
# up by jpackage --app-content (configured in jdm-deb/pom.xml) and
# lands at /opt/jdiskmark/smartctl/smartctl in the installed image.
run: |
curl -fsSL -o smartctl.tar.gz \
https://github.com/JDiskMark/jdm-deps/releases/download/tools%2Fsmartctl-7.5/smartctl-7.5-linux-x86_64.tar.gz
mkdir -p jdm-dist/jdm-deb/src/main/app-content
tar -xzf smartctl.tar.gz -C jdm-dist/jdm-deb/src/main/app-content
# Sanity check: binary must exist and be executable
test -x jdm-dist/jdm-deb/src/main/app-content/smartctl/smartctl
echo "smartctl staging OK:"
jdm-dist/jdm-deb/src/main/app-content/smartctl/smartctl --version || true
- name: Build Fat Debian Package
# -pl targets jdm-core and jdm-deb. -am also builds upstream dependencies.
# Explicitly activating the linux-deb profile to ensure jpackage runs.
run: mvn clean install -pl jdm-core,jdm-dist/jdm-deb -am -Plinux-deb --no-transfer-progress
- name: Upload Fat DEB Artifact
uses: actions/upload-artifact@v7
with:
name: jdiskmark-deb-fat
path: jdm-dist/jdm-deb/target/*.deb
if-no-files-found: error
# archive:false uploads the raw .deb (no zip wrapper) from the Actions tab
archive: false
- name: Smoke test — install DEB and run --help
# jpackage post-install registers a desktop menu entry via xdg-desktop-menu,
# which fails on headless CI runners (no display). Allow dpkg to fail on the
# post-install hook, then invoke the binary directly from its install path.
run: |
sudo dpkg -i jdm-dist/jdm-deb/target/*.deb || true
/opt/jdiskmark/bin/jdiskmark --help
# Verify bundled smartctl was installed correctly
test -x /opt/jdiskmark/smartctl/smartctl
/opt/jdiskmark/smartctl/smartctl --version
# --- FAT DEB COMPAT CHECK — verify the artifact installs on ubuntu-24.04 ---
# Downloads the artifact built above and smoke tests it on 24.04.
# This confirms the single .deb works across both active Ubuntu LTS versions.
smoke-deb-fat-24:
needs: build-deb-fat
runs-on: ubuntu-24.04
steps:
- name: Download Fat DEB Artifact
# archive:false stores the artifact under the actual filename, not the name
# parameter — match by architecture suffix to avoid pulling the slim _all.deb.
uses: actions/download-artifact@v8
with:
pattern: jdiskmark*_amd64.deb
merge-multiple: true
- name: Install and smoke test on Ubuntu 24.04
run: |
sudo dpkg -i *.deb || true
/opt/jdiskmark/bin/jdiskmark --help
# --- LINUX DEBIAN SLIM BUILD (jdeb plugin, system JRE dependency) ---
# Builds once on ubuntu-22.04; slim package is just a JAR + wrapper script,
# not OS-version-specific.
build-deb-slim:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Build Slim Debian Package
# Builds jdm-core (shade fat jar) then assembles the slim .deb via jdeb.
# The slim package depends on the system JRE — no bundled runtime.
run: mvn clean install -pl jdm-core,jdm-dist/jdm-deb-slim -am -Plinux-deb-slim --no-transfer-progress
- name: Upload Slim DEB Artifact
uses: actions/upload-artifact@v7
with:
name: jdiskmark-deb-slim
path: jdm-dist/jdm-deb-slim/target/*.deb
if-no-files-found: error
# archive:false uploads the raw .deb (no zip wrapper) from the Actions tab
archive: false
# --- SLIM DEB COMPAT CHECK — verify the artifact installs on ubuntu-24.04 ---
smoke-deb-slim-24:
needs: build-deb-slim
runs-on: ubuntu-24.04
steps:
- name: Download Slim DEB Artifact
# archive:false stores the artifact under the actual filename, not the name
# parameter — match by _all suffix to avoid pulling the fat _amd64.deb.
uses: actions/download-artifact@v8
with:
pattern: jdiskmark*_all.deb
merge-multiple: true
- name: Set up JDK 25
# The slim jar is compiled for Java 25 (class file version 69). The
# system default-jre on Ubuntu 24.04 is Java 21, which cannot run it.
# setup-java prepends temurin-25 to PATH so the launcher wrapper's
# fallback 'java' resolves to Java 25, not the apt-installed Java 21.
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- name: Install and smoke test on Ubuntu 24.04
run: |
sudo apt-get update -q
sudo apt install -y ./*.deb
jdiskmark --help