Skip to content

autobuild

autobuild #13

Workflow file for this run

name: autobuild
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 1"
permissions:
packages: write
jobs:
matrix:
name: matrix
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
with:
submodules: recursive
- name: generate matrix
run: ./hack/ci/generate-matrix.sh
- name: capture matrix
id: capture-matrix
run: >
echo "matrix=$(cat target/matrix.json)" >> "${GITHUB_OUTPUT}"
outputs:
matrix: "${{ steps.capture-matrix.outputs.matrix }}"
build:
name: "build ${{ matrix.arch }} ${{ matrix.builds.version }}"
needs: matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
runs-on: ubuntu-latest
env:
TARGET_ARCH: "${{ matrix.arch }}"
KERNEL_VERSION: "${{ matrix.builds.version }}"
KERNEL_SRC_URL: "${{ matrix.builds.source }}"
steps:
- name: checkout repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
with:
submodules: recursive
- name: install dependencies
run: ./hack/ci/install-linux-deps.sh
- name: build kernel
run: ./hack/build.sh
env:
KERNEL_BUILD_JOBS: "5"
- name: append tags to metadata
run: >
echo "KERNEL_TAGS=${{ join(matrix.builds.tags) }}" >> "target/metadata"
- name: capture metadata
id: capture-metadata
run: >
cat "target/metadata" >> "${GITHUB_OUTPUT}"
- name: upload artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: "kernel-${{ matrix.arch }}-${{ matrix.builds.version }}"
path: "target/*"
compression-level: 0
outputs:
arch: "${{ steps.capture-metadata.outputs.KERNEL_ARCH }}"
version: "${{ steps.capture-metadata.outputs.KERNEL_VERSION }}"
tags: "${{ steps.capture-metadata.outputs.KERNEL_TAGS }}"
publish:
name: publish
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
with:
submodules: recursive
- name: download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4
with:
pattern: "kernel-*"
path: "target/kernels"
- name: docker setup qemu
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
- name: docker setup buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
- name: docker login ghcr.io
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
with:
registry: ghcr.io
username: "${{github.actor}}"
password: "${{secrets.GITHUB_TOKEN}}"
- name: generate docker script
run: ./hack/ci/generate-docker-script.sh ghcr.io/edera-dev/kernels > target/build.sh
- name: run docker script
run: sh target/build.sh