Files
2022-02-08 11:20:42 -08:00

65 lines
2.3 KiB
YAML

name: Build the Kernel and package it
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Free up disk space for the CI
run: |
df -h
echo "==> Cleaning up disk space for the CI..."
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
df -h
- name: Checkout repo
uses: actions/checkout@v2
- name: Build in Docker
run: |
cat << EOF > dockerBuild.sh
cd /build
useradd builduser -m
passwd -d builduser
emerge-webrsync
emerge --update --deep --newuse @world
USE=zstd emerge sys-apps/kmod
emerge dev-util/pahole app-admin/sudo dev-vcs/git net-misc/curl dev-lang/perl sys-devel/bc app-arch/cpio
printf 'builduser ALL=(ALL) ALL\\n' | tee -a /etc/sudoers
chown -R builduser:builduser ./
sudo -u builduser gpg --keyserver keyserver.ubuntu.com --recv-keys 38DBBDC86092693E
sudo -u builduser bash -c "chmod +x prepare.sh && chmod +x build.sh && chmod +x package.sh"
sudo -u builduser bash -c "./prepare.sh && ./build.sh && ./package.sh"
EOF
docker run -t -v $PWD:/build gentoo/stage3 /bin/bash /build/dockerBuild.sh
- name: Upload Packages
uses: actions/upload-artifact@v2
with:
name: built-packages
path: ${{ github.workspace }}/linux-*-t2-*.tar.xz
- name: Create Tag
id: create_tag
run: |
source INFO
echo "::set-output name=tag::${PKG_VERSION}"
echo $PKG_VERSION
- name: Release
if: ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[no rel]') }}
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.workspace }}/linux-t2-*.tar.xz
tag_name: ${{ steps.create_tag.outputs.tag }}
draft: ${{ contains(github.event.head_commit.message, '[draft]') }}
prerelease: ${{ contains(github.event.head_commit.message, '[prerel]') }}
body : |
Read the README file for install instructions.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}