Skip to content

autobuild

autobuild #34

Workflow file for this run

name: autobuild
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 1"
permissions:
contents: read
packages: write
id-token: write
jobs:
matrix:
name: matrix
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: recursive
- name: generate matrix
run: ./hack/ci/generate-matrix.sh
- name: upload matrix
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: matrix
path: "target/matrix.json"
compression-level: 0
- 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 }} ${{ matrix.builds.flavor }}"
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 }}"
KERNEL_FLAVOR: "${{ matrix.builds.flavor }}"
steps:
- name: checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 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@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: "kernel-${{ matrix.arch }}-${{ matrix.builds.version }}-${{ matrix.builds.flavor }}"
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 }}"
flavor: "${{ steps.capture-metadata.outputs.KERNEL_FLAVOR }}"
publish:
name: publish
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: recursive
- name: install cosign
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
- name: download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
pattern: "kernel-*"
path: "target/kernels"
- name: docker setup qemu
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: docker setup buildx
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3
- name: docker login ghcr.io
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # 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/docker.sh
- name: upload docker script
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: docker-script
path: "target/docker.sh"
- name: run docker script
run: sh target/docker.sh