Skip to content

Commit c49b93c

Browse files
committed
fix(ci): Support version retrieval across kernel variants
Signed-off-by: RJ Trujillo <eyecantcu@pm.me>
1 parent e21e235 commit c49b93c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/reusable-build.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,34 @@ jobs:
144144
145145
# Get kernel version with podman
146146
container_name="fq-$(uuidgen)"
147+
pod_exec="podman exec $container_name"
148+
149+
# Start container and install dnf
147150
podman run --entrypoint /bin/bash --name "$container_name" -dt "${{ env.FQ_SOURCE_IMAGE }}"
148-
installed_packages=$(podman exec "$container_name" rpm -qa)
149-
kernel_suffix="linux"
150-
linux=$(echo $installed_packages | grep -P 'kernel-(|'"$kernel_suffix"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$kernel_suffix"'-)//')
151+
$pod_exec rpm-ostree install dnf dnf-plugins-core
152+
153+
# Fetch kernel version
154+
case "${{ matrix.kernel_flavor }}" in
155+
"asus")
156+
$pod_exec dnf copr enable -y lukenukem/asus-linux
157+
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:lukenukem:asus-kernel --whatprovides kernel | tail -n1 | sed 's/.*://')
158+
;;
159+
"fsync")
160+
$pod_exec dnf copr enable -y sentry/kernel-fsync
161+
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-fsync --whatprovides kernel | tail -n1 | sed 's/.*://')
162+
;;
163+
"fsync-lts")
164+
$pod_exec dnf copr enable -y sentry/kernel-fsync-lts
165+
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-fsync-lts --whatprovides kernel | tail -n1 | sed 's/.*://')
166+
;;
167+
"surface")
168+
$pod_exec dnf config-manager --add-repo=https://pkg.surfacelinux.com/fedora/linux-surface.repo
169+
linux=$($pod_exec dnf repoquery --repoid linux-surface --whatprovides kernel-surface | tail -n1 | sed 's/.*://')
170+
;;
171+
*)
172+
linux=$($pod_exec dnf repoquery --installed --whatprovides kernel | tail -n1 | sed 's/.*://')
173+
;;
174+
esac
151175
152176
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
153177
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)

0 commit comments

Comments
 (0)