Skip to content

Commit

Permalink
fix(ci): Use podman to retrieve kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Apr 13, 2024
1 parent dacfda2 commit 685391e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
kernel_flavor: fsync # kernel-fsync not required for ublue-os F38
- fedora_version: 40
kernel_flavor: fsync # kernel-fsync packages are not being built for F40 yet.

steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
Expand Down Expand Up @@ -135,26 +134,27 @@ jobs:
podman pull ${{ env.FQ_SOURCE_IMAGE }}
- name: Get current version
id: labels
uses: addnab/docker-run-action@v3
with:
image: ${{ env.FQ_SOURCE_IMAGE }}
shell: bash
run: |
set -eo pipefail
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
linux=$(jq -r '.Labels["ostree.linux"]' inspect.json)
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
echo "inspected image version must not be empty or null"
exit 1
fi
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
echo "inspected image linux version must not be empty or null"
exit 1
fi
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
run: |
set -eo pipefail
# Get kernel version with podman
podman run --entrypoint /bin/bash --replace --name "${{ env.FQ_SOURCE_IMAGE }}" -dt "${{ env.FQ_SOURCE_IMAGE }}"
installed_packages=$(podman exec "${{ env.FQ_SOURCE_IMAGE }}" rpm -qa)
kernel_suffix="linux"
linux=$(echo $installed_packages | grep -P 'kernel-(|'"$kernel_suffix"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$kernel_suffix"'-)//')
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
echo "inspected image version must not be empty or null"
exit 1
fi
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
echo "inspected image linux version must not be empty or null"
exit 1
fi
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
# Build metadata
- name: Image Metadata
Expand All @@ -167,7 +167,7 @@ jobs:
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=A caching layer for pre-built akmod RPMs
org.opencontainers.image.version=${{ env.SOURCE_IMAGE_VERSION }}
ostree.linux=${{ env.SOURCE_IMAGE_LINUX }}
akmods.linux=${{ env.SOURCE_IMAGE_LINUX }}
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/1728152?s=200&v=4
Expand Down

0 comments on commit 685391e

Please sign in to comment.