6060 strategy :
6161 fail-fast : false
6262 matrix :
63- os : [fedora:latest, fedora:41]
63+ include :
64+ - os : fedora:latest
65+ artifact : fedora-latest
66+ - os : fedora:41
67+ artifact : fedora-41
6468
6569 container :
6670 image : ${{ matrix.os }}
@@ -86,36 +90,33 @@ jobs:
8690 python3-lxml
8791
8892 - name : Set up RPM build tree
89- run : rpmdev-setuptree
93+ run : rpmdev-setuptree || mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
9094
9195 - name : Create source tarball
9296 run : |
93- VERSION=$(grep "version: " meson.build | head -1 | sed "s/.*'\(.*\)'.*/\1/" )
97+ VERSION=$(grep -oP "version\s*:\s*'\K[^']+ " meson.build | head -1)
9498 echo "Building version $VERSION"
95- tar czf ~/rpmbuild/SOURCES/ systemd-netlogd-$VERSION.tar.gz \
96- --transform "s, ^\., systemd-netlogd-$VERSION," \
97- --exclude='.git' --exclude='builddir' \
98- .
99+ mkdir -p /tmp/ systemd-netlogd-$VERSION
100+ cp -a $(ls -A | grep -v ' ^\.\(git\)$' | grep -v '^builddir$') /tmp/ systemd-netlogd-$VERSION/
101+ tar czf $HOME/rpmbuild/SOURCES/systemd-netlogd-$VERSION.tar.gz -C /tmp systemd-netlogd-$VERSION
102+ ls -lh $HOME/rpmbuild/SOURCES/
99103
100104 - name : Copy spec file
101- run : cp systemd-netlogd.spec ~ /rpmbuild/SPECS/
105+ run : cp systemd-netlogd.spec $HOME /rpmbuild/SPECS/
102106
103107 - name : Build RPMs
104- run : rpmbuild -ba ~ /rpmbuild/SPECS/systemd-netlogd.spec
108+ run : rpmbuild -ba $HOME /rpmbuild/SPECS/systemd-netlogd.spec
105109
106110 - name : Test install RPM
107111 run : |
108- dnf install -y ~ /rpmbuild/RPMS/*/systemd-netlogd-*.rpm
112+ rpm -ivh --nodeps $HOME /rpmbuild/RPMS/*/systemd-netlogd-*.rpm
109113 rpm -qi systemd-netlogd
110- systemctl status systemd-netlogd || true
111114
112115 - name : Upload RPM artifacts
113116 uses : actions/upload-artifact@v4
114117 with :
115- name : rpms-${{ matrix.os }}
116- path : |
117- ~/rpmbuild/RPMS/*/*.rpm
118- ~/rpmbuild/SRPMS/*.rpm
118+ name : rpms-${{ matrix.artifact }}
119+ path : /github/home/rpmbuild/RPMS/
119120 retention-days : 30
120121
121122 build-rpm-rocky :
@@ -148,39 +149,36 @@ jobs:
148149 python3-sphinx \
149150 python3-devel \
150151 python3-lxml
151- pip3 install meson ninja
152+ pip3 install --prefix=/usr meson ninja
152153
153154 - name : Set up RPM build tree
154- run : rpmdev-setuptree
155+ run : rpmdev-setuptree || mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
155156
156157 - name : Create source tarball
157158 run : |
158- VERSION=$(grep "version: " meson.build | head -1 | sed "s/.*'\(.*\)'.*/\1/" )
159+ VERSION=$(grep -oP "version\s*:\s*'\K[^']+ " meson.build | head -1)
159160 echo "Building version $VERSION"
160- tar czf ~/rpmbuild/SOURCES/ systemd-netlogd-$VERSION.tar.gz \
161- --transform "s, ^\., systemd-netlogd-$VERSION," \
162- --exclude='.git' --exclude='builddir' \
163- .
161+ mkdir -p /tmp/ systemd-netlogd-$VERSION
162+ cp -a $(ls -A | grep -v ' ^\.\(git\)$' | grep -v '^builddir$') /tmp/ systemd-netlogd-$VERSION/
163+ tar czf $HOME/rpmbuild/SOURCES/systemd-netlogd-$VERSION.tar.gz -C /tmp systemd-netlogd-$VERSION
164+ ls -lh $HOME/rpmbuild/SOURCES/
164165
165166 - name : Copy spec file
166- run : cp systemd-netlogd.spec ~ /rpmbuild/SPECS/
167+ run : cp systemd-netlogd.spec $HOME /rpmbuild/SPECS/
167168
168169 - name : Build RPMs
169- run : rpmbuild -ba ~ /rpmbuild/SPECS/systemd-netlogd.spec
170+ run : rpmbuild -ba --nodeps $HOME /rpmbuild/SPECS/systemd-netlogd.spec
170171
171172 - name : Test install RPM
172173 run : |
173- dnf install -y ~ /rpmbuild/RPMS/*/systemd-netlogd-*.rpm
174+ rpm -ivh --nodeps $HOME /rpmbuild/RPMS/*/systemd-netlogd-*.rpm
174175 rpm -qi systemd-netlogd
175- systemctl status systemd-netlogd || true
176176
177177 - name : Upload RPM artifacts
178178 uses : actions/upload-artifact@v4
179179 with :
180180 name : rpms-rockylinux-9
181- path : |
182- ~/rpmbuild/RPMS/*/*.rpm
183- ~/rpmbuild/SRPMS/*.rpm
181+ path : /github/home/rpmbuild/RPMS/
184182 retention-days : 30
185183
186184 build-deb :
@@ -189,7 +187,13 @@ jobs:
189187 strategy :
190188 fail-fast : false
191189 matrix :
192- os : [ubuntu:24.04, ubuntu:22.04, debian:12]
190+ include :
191+ - os : ubuntu:24.04
192+ artifact : ubuntu-24.04
193+ - os : ubuntu:22.04
194+ artifact : ubuntu-22.04
195+ - os : debian:12
196+ artifact : debian-12
193197
194198 container :
195199 image : ${{ matrix.os }}
@@ -220,17 +224,24 @@ jobs:
220224 - name : Build DEB package
221225 run : dpkg-buildpackage -us -uc -b
222226
227+ - name : Collect DEB packages
228+ run : |
229+ mkdir -p debs
230+ cp ../*.deb debs/ || true
231+ ls -lh debs/
232+
223233 - name : Test install DEB
224234 run : |
225- dpkg -i .. /systemd-netlogd_*.deb || apt-get install -f -y
235+ dpkg -i debs /systemd-netlogd_*.deb || apt-get install -f -y
226236 dpkg -s systemd-netlogd
227237 systemctl status systemd-netlogd || true
228238
229239 - name : Upload DEB artifacts
230240 uses : actions/upload-artifact@v4
241+ if : always()
231242 with :
232- name : debs-${{ matrix.os }}
233- path : ../*.deb
243+ name : debs-${{ matrix.artifact }}
244+ path : debs/
234245 retention-days : 30
235246
236247 build-archlinux :
0 commit comments