Kernel Build #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Kernels | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| spec: | |
| description: 'Build Specification' | |
| type: string | |
| default: "new" | |
| required: true | |
| publish: | |
| description: 'Publish Builds' | |
| type: boolean | |
| default: true | |
| required: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| concurrency: | |
| group: "kernel-builder" | |
| jobs: | |
| matrix: | |
| name: matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | |
| with: | |
| egress-policy: audit | |
| - name: checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| submodules: recursive | |
| - name: install dependencies | |
| run: ./hack/build/install-matrix-deps.sh | |
| - name: generate matrix | |
| run: 'PATH="${HOME}/go/bin:${PATH}" ./hack/build/generate-matrix.sh "${{ inputs.spec }}"' | |
| - name: upload matrix | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: matrix | |
| path: "matrix.json" | |
| compression-level: 0 | |
| - name: capture matrix | |
| id: capture-matrix | |
| run: > | |
| echo "matrix=$(cat matrix.json)" >> "${GITHUB_OUTPUT}" | |
| outputs: | |
| matrix: "${{ steps.capture-matrix.outputs.matrix }}" | |
| build: | |
| name: "build ${{ matrix.builds.version }} ${{ matrix.builds.flavor }}" | |
| needs: matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} | |
| runs-on: "${{ matrix.builds.runner }}" | |
| env: | |
| KERNEL_PUBLISH: "${{ inputs.publish }}" | |
| KERNEL_VERSION: "${{ matrix.builds.version }}" | |
| KERNEL_SRC_URL: "${{ matrix.builds.source }}" | |
| FIRMWARE_URL: "${{ matrix.builds.firmware_url }}" | |
| FIRMWARE_SIG_URL: "${{ matrix.builds.firmware_sig_url }}" | |
| KERNEL_FLAVOR: "${{ matrix.builds.flavor }}" | |
| KERNEL_TAGS: "${{ join(matrix.builds.tags, ',') }}" | |
| KERNEL_ARCHITECTURES: "${{ join(matrix.builds.architectures, ',') }}" | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1 | |
| with: | |
| egress-policy: audit | |
| - name: checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| submodules: recursive | |
| - name: install cosign | |
| uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2 | |
| - name: docker setup linux-kernel-oci | |
| run: sudo python3 ./hack/build/docker-setup.py | |
| - name: docker setup buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 | |
| - name: docker login ghcr.io | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: "${{github.actor}}" | |
| password: "${{secrets.GITHUB_TOKEN}}" | |
| - name: generate docker script | |
| run: "./hack/build/generate-docker-script.sh" | |
| - name: upload docker script | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: "build-${{ matrix.builds.version }}-${{ matrix.builds.flavor }}.sh" | |
| path: "docker.sh" | |
| compression-level: 0 | |
| - name: run docker script | |
| run: sh -x docker.sh |