Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .github/workflows/build-all-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
env:
DOCKER_ARCH: "${{ matrix.docker_arch }}"
DO_PUSH: "${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
EXPORT_LK_CONTAINERS: "${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
EXPORT_LK_CONTAINERS: "${{ github.ref != 'refs/heads/main' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
EXPORT_LK_CONTAINERS_DIR: "${{ runner.temp }}"
run: bash build.sh linuxkit-containers

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Build and Push and Export Kernel ${{matrix.kernel}} (${{ matrix.arch }})
env:
DO_PUSH: "${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
EXPORT_KERNEL_IMAGE: "${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
EXPORT_KERNEL_IMAGE: "${{ github.ref != 'refs/heads/main' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
EXPORT_KERNEL_IMAGE_DIR: "${{ runner.temp }}"
run: bash build.sh build-kernel "${{ matrix.kernel }}"

Expand Down Expand Up @@ -201,11 +201,13 @@ jobs:

- name: Download Linuxkit artifacts
uses: actions/download-artifact@v5
if: ${{ github.ref != 'refs/heads/main' }}
with:
name: linuxkit-images-${{ matrix.docker_arch }}
path: ${{ runner.temp }}

- name: Load Linuxkit Docker images into local Docker daemon
if: ${{ github.ref != 'refs/heads/main' }}
run: |
ls "${{ runner.temp }}"
imgs=$(ls "${{ runner.temp }}" | grep tar.gz | xargs)
Expand All @@ -219,11 +221,13 @@ jobs:

- name: Download Kernel artifacts
uses: actions/download-artifact@v5
if: ${{ github.ref != 'refs/heads/main' }}
with:
name: kernel-images-${{ matrix.kernel }}
path: ${{ runner.temp }}

- name: Load Kernel Docker images into local Docker daemon
if: ${{ github.ref != 'refs/heads/main' }}
run: |
ls "${{ runner.temp }}"
imgs=$(ls "${{ runner.temp }}" | grep tar.gz | xargs)
Expand Down
4 changes: 4 additions & 0 deletions bash/kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ function kernel_build() {
if docker pull "${kernel_oci_image}"; then
log info "Kernel image ${kernel_oci_image} already in registry; skipping build."
log info "Set FORCE_BUILD_KERNEL=yes to force a build; use DO_PUSH=yes to also push after build."
if [[ "${EXPORT_KERNEL_IMAGE}" == "yes" ]]; then
log info "Exporting kernel image ${kernel_oci_image} to ${EXPORT_KERNEL_IMAGE_DIR}"
save_docker_image_to_tar_gz "${kernel_oci_image}" "${EXPORT_KERNEL_IMAGE_DIR}"
fi
exit 0
fi
fi
Expand Down
Loading