Skip to content

Commit

Permalink
fix(ci): Support version retrieval across kernel variants
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Trujillo <[email protected]>
  • Loading branch information
EyeCantCU committed Apr 14, 2024
1 parent e21e235 commit c49b93c
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,34 @@ jobs:
# Get kernel version with podman
container_name="fq-$(uuidgen)"
pod_exec="podman exec $container_name"
# Start container and install dnf
podman run --entrypoint /bin/bash --name "$container_name" -dt "${{ env.FQ_SOURCE_IMAGE }}"
installed_packages=$(podman exec "$container_name" rpm -qa)
kernel_suffix="linux"
linux=$(echo $installed_packages | grep -P 'kernel-(|'"$kernel_suffix"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$kernel_suffix"'-)//')
$pod_exec rpm-ostree install dnf dnf-plugins-core
# Fetch kernel version
case "${{ matrix.kernel_flavor }}" in
"asus")
$pod_exec dnf copr enable -y lukenukem/asus-linux
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:lukenukem:asus-kernel --whatprovides kernel | tail -n1 | sed 's/.*://')
;;
"fsync")
$pod_exec dnf copr enable -y sentry/kernel-fsync
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-fsync --whatprovides kernel | tail -n1 | sed 's/.*://')
;;
"fsync-lts")
$pod_exec dnf copr enable -y sentry/kernel-fsync-lts
linux=$($pod_exec dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-fsync-lts --whatprovides kernel | tail -n1 | sed 's/.*://')
;;
"surface")
$pod_exec dnf config-manager --add-repo=https://pkg.surfacelinux.com/fedora/linux-surface.repo
linux=$($pod_exec dnf repoquery --repoid linux-surface --whatprovides kernel-surface | tail -n1 | sed 's/.*://')
;;
*)
linux=$($pod_exec dnf repoquery --installed --whatprovides kernel | tail -n1 | sed 's/.*://')
;;
esac
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
Expand Down

0 comments on commit c49b93c

Please sign in to comment.