Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

fix: use tar options to enable extraction on F40 based source #15

Merged
merged 26 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ad435e
fix: use tar options to enable extraction on F40 based source
bsherman May 1, 2024
8da2110
fix: mount /tmp as tmpfs to workaround tar file ops bug
bsherman May 2, 2024
5ce3d90
hack to investigate how rpmbuild uses tar
bsherman May 2, 2024
e64cf4c
temporarily only build ZFS for debug
bsherman May 2, 2024
14816e8
huh?
bsherman May 2, 2024
3e71aea
typo, simple, hack
bsherman May 2, 2024
983d08a
hack, use tar-actual for initial zfs extract
bsherman May 2, 2024
fdb1acb
don't use self-executing quotes for tar
bsherman May 2, 2024
576b3c9
remove the tar-hack stuff
bsherman May 2, 2024
0529497
fix(ci): use docker-buildx instead of podman-buildah
bsherman May 2, 2024
a39fa7e
Revert "fix(ci): use docker-buildx instead of podman-buildah"
bsherman May 2, 2024
052d02b
fix(ci): use ubuntu-24.04
bsherman May 2, 2024
c40dbd5
Revert "fix(ci): use ubuntu-24.04"
bsherman May 2, 2024
c4bdcd9
fix(ci): use docker-buildx instead of podman-buildah (again)
bsherman May 2, 2024
c200444
fix(ci): buildx tags are different
bsherman May 2, 2024
324e602
fix(ci): multiline env
bsherman May 2, 2024
5afb623
forgot a quote
bsherman May 2, 2024
e761a3e
tricky multiline
bsherman May 2, 2024
8ff5bc9
tricky multiline 2
bsherman May 2, 2024
fcbc118
fix(ci): use alias_tags are image tags
bsherman May 2, 2024
a8341da
fix(ci): pass tags via docker metadata
bsherman May 2, 2024
de78532
revert: temporarily only build ZFS for debug
bsherman May 2, 2024
70050be
fix(ci): braces
bsherman May 2, 2024
3f0f7ae
chore: revert tar-hack conditional
bsherman May 2, 2024
91545de
fix(ci): use build_image digest now that it pushes, too
bsherman May 2, 2024
70a4327
echo build_image.outputs not push
bsherman May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 33 additions & 41 deletions .github/workflows/build.yml
p5 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ jobs:

echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT

# in addition to existing tag logic, add docker/metadata friendly tags
METADATA_TAGS=$(
for TAG in "${alias_tags[@]}"; do
echo "${TAG}"
done)
echo "METADATA_TAGS<<EOF" >> $GITHUB_ENV
echo "$METADATA_TAGS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Retrieve akmods signing key
run: |
mkdir -p certs
Expand All @@ -83,61 +92,30 @@ jobs:
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "LINUX=$linux" >> $GITHUB_OUTPUT

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_REGISTRY }}

# Build metadata
- name: Image Metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ env.IMAGE_NAME }}
${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=A caching layer for pre-built kmod RPMs
org.opencontainers.image.version=${{ steps.labels.outputs.VERSION }}
ostree.linux=${{ steps.labels.outputs.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

# Build image using Buildah action
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
./Containerfile
image: ${{ env.IMAGE_NAME }}
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
SOURCE_IMAGE=${{ env.SOURCE_IMAGE }}
COREOS_VERSION=${{ matrix.coreos_version }}
labels: ${{ steps.meta.outputs.labels }}
oci: false

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_REGISTRY }}

# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
if: github.event_name != 'pull_request'
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ steps.registry_case.outputs.lowercase }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust
${{ env.METADATA_TAGS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -147,6 +125,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build/push image using docker buildx action
- name: Build and Push Image
id: build_image
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
context: .
file: ./Containerfile
build-args: |
SOURCE_IMAGE=${{ env.SOURCE_IMAGE }}
COREOS_VERSION=${{ matrix.coreos_version }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

# Sign container
- uses: sigstore/[email protected]
if: github.event_name != 'pull_request'
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ rpm-ostree install libtirpc-devel libblkid-devel libuuid-devel libudev-devel ope
### BUILD zfs
echo "getting zfs-${ZFS_VERSION}.tar.gz"
curl -L -O https://github.com/openzfs/zfs/releases/download/zfs-${ZFS_VERSION}/zfs-${ZFS_VERSION}.tar.gz
tar xzf zfs-${ZFS_VERSION}.tar.gz
# no-same-owner/no-same-permissions required for F40 based images building on podman 3.4.4 (ubuntu 22.04)
tar -z -x --no-same-owner --no-same-permissions -f zfs-${ZFS_VERSION}.tar.gz
bsherman marked this conversation as resolved.
Show resolved Hide resolved

# patch the zfs-kmod.spec.in file for older zfs versions
ZFS_MAJ=$(echo $ZFS_VERSION | cut -f1 -d.)
Expand Down
Loading