diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc6fdcb5b0..7d791a2745 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,7 @@ jobs: fail-fast: false matrix: base_image_flavor: [main] - base_name: [bazzite, bazzite-deck, bazzite-nvidia] + base_name: [bazzite, bazzite-deck, bazzite-nvidia, bazzite-deck-nvidia] base_image_name: [kinoite, silverblue] target_image_flavor: [main, asus] target_nvidia_flavor: [nvidia, nvidia-open] @@ -77,10 +77,22 @@ jobs: target_nvidia_flavor: nvidia - base_name: bazzite-deck target_nvidia_flavor: nvidia + - base_name: bazzite-deck-nvidia + target_nvidia_flavor: nvidia + - base_name: bazzite-deck-nvidia + target_image_flavor: asus steps: + - name: Define env.CONTAINER_TARGET + run: | + if [[ "${{ matrix.base_name }}" == "bazzite-deck-nvidia" ]]; then + echo "CONTAINER_TARGET=bazzite-nvidia" >> $GITHUB_ENV + else + echo "CONTAINER_TARGET=${{ matrix.base_name }}" >> $GITHUB_ENV + fi + - name: Define env.IMAGE_FLAVOR run: | - if [[ "${{ matrix.base_name }}" == "bazzite-nvidia" ]]; then + if [[ "${{ matrix.base_name }}" =~ "nvidia" ]]; then if [[ "${{ matrix.target_image_flavor }}" == "main" ]]; then echo "IMAGE_FLAVOR=${{ matrix.target_nvidia_flavor }}" >> $GITHUB_ENV else @@ -103,6 +115,8 @@ jobs: else echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite-deck', '${DESKTOP}') }}" >> $GITHUB_ENV fi + elif [[ "${{ matrix.base_name }}" == "bazzite-deck-nvidia" ]]; then + echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite-deck-nvidia', '${DESKTOP}') }}" >> $GITHUB_ENV else if [[ "${{ env.IMAGE_FLAVOR }}" == "main" ]]; then echo "IMAGE_NAME=${{ format('{0}{1}', 'bazzite', '${DESKTOP}') }}" >> $GITHUB_ENV @@ -111,6 +125,14 @@ jobs: fi fi + - name: Define env.NVIDIA_BASE + run: | + if [[ "${{ matrix.base_name }}" == "bazzite-deck-nvidia" ]]; then + echo "NVIDIA_BASE=bazzite-deck" >> $GITHUB_ENV + else + echo "NVIDIA_BASE=bazzite" >> $GITHUB_ENV + fi + - name: Define env.SHA_HEAD_SHORT run: | echo "SHA_HEAD_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV @@ -230,10 +252,11 @@ jobs: id: build_image run: | sudo buildah build \ - --target ${{ matrix.base_name }} \ + --target ${{ env.CONTAINER_TARGET }} \ --build-arg IMAGE_NAME=${{ env.IMAGE_NAME }} \ --build-arg IMAGE_FLAVOR=${{ env.IMAGE_FLAVOR }} \ --build-arg NVIDIA_FLAVOR=${{ matrix.target_nvidia_flavor }} \ + --build-arg NVIDIA_BASE=${{ env.NVIDIA_BASE }} \ --build-arg IMAGE_VENDOR=${{ github.repository_owner }} \ --build-arg BASE_IMAGE_NAME=${{ matrix.base_image_name }} \ --build-arg BASE_IMAGE_FLAVOR=${{ matrix.base_image_flavor }} \ diff --git a/Containerfile b/Containerfile index 5ae6143354..4cdc95314b 100644 --- a/Containerfile +++ b/Containerfile @@ -2,6 +2,7 @@ ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-kinoite}" ARG BASE_IMAGE_FLAVOR="${BASE_IMAGE_FLAVOR:-main}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}" ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}" +ARG NVIDIA_BASE="${NVIDIA_BASE:-bazzite}" ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}" ARG KERNEL_VERSION="${KERNEL_VERSION:-6.12.5-204.bazzite.fc41.x86_64}" ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}" @@ -23,6 +24,7 @@ ARG IMAGE_NAME="${IMAGE_NAME:-bazzite}" ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}" ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}" +ARG NVIDIA_BASE="${NVIDIA_BASE:-bazzite}" ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}" ARG KERNEL_VERSION="${KERNEL_VERSION:-6.12.5-204.bazzite.fc41.x86_64}" ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}" @@ -829,6 +831,7 @@ ARG IMAGE_NAME="${IMAGE_NAME:-bazzite-deck}" ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}" ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}" +ARG NVIDIA_BASE="${NVIDIA_BASE:-bazzite}" ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}" ARG KERNEL_VERSION="${KERNEL_VERSION:-6.12.5-204.bazzite.fc41.x86_64}" ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}" @@ -995,12 +998,14 @@ RUN /usr/libexec/containerbuild/image-info && \ FROM ghcr.io/ublue-os/akmods-${NVIDIA_FLAVOR}:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION}-${KERNEL_VERSION} AS nvidia-akmods -FROM bazzite AS bazzite-nvidia +FROM ${NVIDIA_BASE} AS bazzite-nvidia ARG IMAGE_NAME="${IMAGE_NAME:-bazzite-nvidia}" ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-nvidia}" ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}" +ARG NVIDIA_BASE="${NVIDIA_BASE:-bazzite}" +ARG NVIDIA_NAME=${NVIDIA_NAME:-bazzite-nvidia} ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}" ARG KERNEL_VERSION="${KERNEL_VERSION:-6.12.5-204.bazzite.fc41.x86_64}" ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"