name: revyos-kernel-build on: push: pull_request: workflow_dispatch: schedule: - cron: "0 2 * * *" env: xuantie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395627867 toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.1-20240115.tar.gz mainline_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.03.01 mainline_toolchain_file_name: riscv64-glibc-ubuntu-22.04-gcc-nightly-2024.03.01-nightly.tar.gz wget_alias: 'wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0' ARCH: riscv board: th1520 KBUILD_BUILD_USER: builder KBUILD_BUILD_HOST: revyos-riscv-builder KDEB_COMPRESS: xz KDEB_CHANGELOG_DIST: unstable jobs: kernel: strategy: fail-fast: false matrix: include: - name: gcc-13 cross: riscv64-unknown-linux-gnu- machine: ubuntu-22.04 run_image: ubuntu:22.04 - name: thead-gcc cross: riscv64-unknown-linux-gnu- machine: ubuntu-22.04 run_image: ubuntu:22.04 - name: native cross: riscv64-linux-gnu- machine: [ self-hosted, Linux, riscv64 ] run_image: riscv64/debian:sid-20240330 runs-on: ${{ matrix.machine }} container: image: ${{ matrix.run_image }} env: CROSS_COMPILE: ${{ matrix.cross }} steps: - name: Install software run: | apt update && \ apt install -y gdisk dosfstools build-essential \ libncurses-dev gawk flex bison openssl libssl-dev tree \ dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf device-tree-compiler \ devscripts pahole bc rsync bash wget cpio sudo python-is-python3 apt install -y nodejs ln -sf /bin/bash /bin/sh - name: Checkout kernel uses: actions/checkout@v4 with: path: 'kernel' - name: Compile Kernel && Install run: | mkdir -p rootfs if [[ ${{ matrix.name }} = "thead-gcc" ]]; then ${wget_alias} ${xuantie_toolchain}/${toolchain_file_name} tar -xvf ${toolchain_file_name} -C /opt export PATH="/opt/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.1/bin:$PATH" elif [[ ${{ matrix.name }} = "gcc-13" ]]; then ${wget_alias} ${mainline_toolchain}/${mainline_toolchain_file_name} tar -xvf ${mainline_toolchain_file_name} -C /opt export PATH="/opt/riscv/bin:$PATH" else echo "No download toolchain." fi ${CROSS_COMPILE}gcc -v pushd kernel make revyos_defconfig export KDEB_PKGVERSION="$(date "+%Y.%m.%d.%H.%M")+$(git rev-parse --short HEAD)" sed -i '/CONFIG_LOCALVERSION_AUTO/d' .config && echo "CONFIG_LOCALVERSION_AUTO=n" >> .config cat .config | grep "CONFIG_THEAD_ISA" make -j$(nproc) bindeb-pkg LOCALVERSION="-${board}" # Copy deb dcmd cp -v ../*.changes ${GITHUB_WORKSPACE}/rootfs/ # record commit-id git rev-parse HEAD > kernel-commitid cp -v kernel-commitid ${GITHUB_WORKSPACE}/rootfs/ ls -al ${GITHUB_WORKSPACE}/rootfs/ popd - name: 'Upload Artifact' uses: actions/upload-artifact@v4 with: name: thead-kernel-${{ matrix.name }} path: rootfs/* retention-days: 30