Skip to content

Commit

Permalink
feat(ci): Initial support for aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Trujillo <[email protected]>
  • Loading branch information
EyeCantCU committed Mar 24, 2024
1 parent a52bdef commit 04de4c7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 203 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- mate
- vauxite
major_version: [38, 39]
build_arch: [aarch64, x86_64]
build_target: [nokmods, kmods]
include:
- major_version: 38
Expand All @@ -54,6 +55,22 @@ jobs:
# Fedora 39+ images do not include custom kmods (legacy)
- build_target: kmods
major_version: 39
# Only build aarch64 images for F39, F38 is approaching EOL
- build_arch: aarch64
major_version: 38
# Disable images without aarch64 support
- build_arch: aarch64
image_name: onyx
- build_arch: aarch64
image_name: base
- build_arch: aarch64
image_name: lxqt
- build_arch: aarch64
image_name: lazurite
- build_arch: aarch64
image_name: mate
- build_arch: aarch64
image_name: vauxite
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
Expand All @@ -62,27 +79,34 @@ jobs:
- name: Matrix Variables
shell: bash
run: |
if [[ "${{ matrix.major_version }}" -ge "40" ]] && \
grep "${{ matrix.image_name }}" <<< "silverblue, kinoite, sericea"; then
if [[ "${{ matrix.build_arch }}" == "aarch64" ]]; then
echo "TARGET_CONTAINERFILE=./Containerfile.aarch64" >> $GITHUB_ENV
echo "SOURCE_ORG=fedora" >> $GITHUB_ENV
echo "SOURCE_IMAGE=fedora-${{ matrix.image_name }}" >> $GITHUB_ENV
else
if [[ "${{ matrix.image_name }}" == "lxqt" || "${{ matrix.image_name }}" == "mate" ]]; then
echo "SOURCE_IMAGE=base" >> $GITHUB_ENV
echo "TARGET_CONTAINERFILE=./Containerfile.x86_64" >> $GITHUB_ENV
if [[ "${{ matrix.major_version }}" -ge "40" ]] && \
grep "${{ matrix.image_name }}" <<< "silverblue, kinoite, sericea"; then
echo "SOURCE_ORG=fedora" >> $GITHUB_ENV
echo "SOURCE_IMAGE=fedora-${{ matrix.image_name }}" >> $GITHUB_ENV
else
echo "SOURCE_IMAGE=${{ matrix.image_name }}" >> $GITHUB_ENV
if [[ "${{ matrix.image_name }}" == "lxqt" || "${{ matrix.image_name }}" == "mate" ]]; then
echo "SOURCE_IMAGE=base" >> $GITHUB_ENV
else
echo "SOURCE_IMAGE=${{ matrix.image_name }}" >> $GITHUB_ENV
fi
echo "SOURCE_ORG=fedora-ostree-desktops" >> $GITHUB_ENV
fi
echo "SOURCE_ORG=fedora-ostree-desktops" >> $GITHUB_ENV
fi
# THE FOLLOWING IS MESSY BUT TEMPORARY UNTIL F38 IS GONE
# see: https://github.com/ublue-os/main/issues/369
# Fedora 39+ images do not include custom kmods (legacy)
if [[ "${{ matrix.major_version}}" -ge "39" && "${{ matrix.build_target }}" == "nokmods" ]]; then
if [[ "${{ matrix.major_version }}" -ge "39" && "${{ matrix.build_target }}" == "nokmods" ]]; then
export IMAGE_FLAVOR=main
elif [[ "${{ matrix.major_version}}" -lt "39" && "${{ matrix.build_target }}" == "nokmods" ]]; then
elif [[ "${{ matrix.major_version }}" -lt "39" && "${{ matrix.build_target }}" == "nokmods" ]]; then
export IMAGE_FLAVOR=nokmods
elif [[ "${{ matrix.major_version}}" -lt "39" && "${{ matrix.build_target }}" == "kmods" ]]; then
elif [[ "${{ matrix.major_version }}" -lt "39" && "${{ matrix.build_target }}" == "kmods" ]]; then
export IMAGE_FLAVOR=main
else
echo "ERROR: invalid workflow request - ${{ matrix.major_version }} - ${{ matrix.build_target }}"
Expand Down Expand Up @@ -182,16 +206,17 @@ jobs:
command: |
# pull the base image used for FROM in containerfile so
# we can retry on that unfortunately common failure case
podman pull quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }}
docker pull --platform linux/${{ matrix.build_arch }} quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }}
# Build image using Buildah action
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
./Containerfile
${{ env.TARGET_CONTAINERFILE }}
image: ${{ env.IMAGE_NAME }}
arch: ${{ matrix.build_arch }}
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
Expand Down
192 changes: 0 additions & 192 deletions .github/workflows/build.yml.save

This file was deleted.

11 changes: 11 additions & 0 deletions Containerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-fedora-silverblue}"
ARG SOURCE_ORG="${SOURCE_ORG:-fedora}"
ARG BASE_IMAGE="quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS nokmods

run rm -rf /tmp/* /var/* && \
ostree container commit && \
mkdir -p /var/tmp && chmod -R 1777 /var/tmp
File renamed without changes.

0 comments on commit 04de4c7

Please sign in to comment.