Skip to content

config: Make sure nf_tables.ko is built #6

config: Make sure nf_tables.ko is built

config: Make sure nf_tables.ko is built #6

Workflow file for this run

# This job builds test kernels and uploads them to the `assets` dummy release.
#
# It works by looking at the KERNELS file in the repository and checks it
# against all the already-uploaded kernels.
name: Kernels
on:
push:
branches: [ "master" ]
concurrency:
# Ensure only a single instance of this job is run at any time
group: ${{ github.ref }}
permissions:
contents: write
jobs:
build-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Calculate needed kernels
id: calculate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
existing=$(gh release view assets --json assets --jq '.[][].name')
# Begin multiline output parameter
echo "NEEDED_KERNELS<<MULTILINE_EOF" >> "$GITHUB_OUTPUT"
echo "$existing" | python3 -c '
import sys
# Calculate kernels that have already been uploaded
existing = {line.strip() for line in sys.stdin}
with open("./KERNELS", "r") as f:
lines = {line.strip() for line in f if line.strip()}
# Print to stdout kernel we need to build and upload
for line in lines:
version = line.strip()
name = f"linux-{version}.tar.zst"
if name not in existing:
print(line)
' | tee -a "$GITHUB_OUTPUT"
# End multiline output parameter
echo "MULTILINE_EOF" >> "$GITHUB_OUTPUT"
- name: Build needed kernels
run: |
while IFS= read -r version; do
echo "Building: ${version}"
./build.sh "$version"
done <<< "${{ steps.calculate.outputs.NEEDED_KERNELS }}"
- name: Upload freshly built kernels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for kernel in linux-*; do
gh release upload assets "$kernel"
done