From 37a0ee3dc34e41b838acb52651bdb3247be3df35 Mon Sep 17 00:00:00 2001 From: Vaisakh Murali Date: Thu, 25 May 2023 03:58:34 +0000 Subject: [PATCH] workflows: Add Initial Build Rules Change-Id: I8640c28927d9ec7838b8627d6ffa63c9a4c2bf8b Co-authored-by: neilchetty --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++++ .github/workflows/rebase.yml | 51 ++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 3 files changed, 101 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/rebase.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000000..92df6ccc839a7b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build + +on: + schedule: [cron: '0 0 * * 0'] + workflow_dispatch: + +env: + GH_TOKEN: ${{ secrets.GIT_TOKEN }} + +permissions: + contents: write + +jobs: + build: + + name: Automatic Build + runs-on: ubuntu-latest + container: + image: fedora:latest + + steps: + - name: Setup + run: | + sudo dnf groupinstall "Development tools" -y + sudo dnf install bison flex bc openssl-devel -y + sudo dnf install 'dnf-command(config-manager)' -y + sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo -y + sudo dnf install gh -y + ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime + echo "date=$(/bin/date -u '+%d%m%Y%I%M')" >> $GITHUB_ENV + git config --global --add safe.directory /__w/wsl-kernel/wsl-kernel + git config --global user.name "neilchetty" + git config --global user.email "neilchetty4559@gmail.com" + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Build + run: | + export KBUILD_BUILD_USER="neil" && export KBUILD_BUILD_HOST="kernel-build" + make wsl_defconfig && make -j$(nproc --all) + echo "kversion=$(strings arch/x86_64/boot/bzImage | grep neil | grep gcc)" >> $GITHUB_ENV + mkdir -p releases && cp arch/x86_64/boot/bzImage releases/bzImage + + - name: Release + run: | + gh release create ${{ env.date }} 'releases/bzImage#kernel' --notes "Version String: ${{ env.kversion }}" --generate-notes -t "Bluelight Kernel for WSL Release ${{ env.date }}" diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 00000000000000..6a67ee40319f65 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,51 @@ +name: Rebase + +on: + schedule: [cron: '0 0 * * *'] + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + + name: Automatic Rebase + runs-on: ubuntu-latest + container: + image: fedora:latest + + steps: + - name: Setup + run: | + sudo dnf groupinstall "Development tools" -y + sudo dnf install bison flex bc openssl-devel -y + sudo dnf install 'dnf-command(config-manager)' -y + sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo -y + sudo dnf install gh -y + ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime + echo "date=$(/bin/date -u '+%d%m%Y%I%M')" >> $GITHUB_ENV + git config --global --add safe.directory /__w/wsl-kernel/wsl-kernel + git config --global user.name "neilchetty" + git config --global user.email "neilchetty4559@gmail.com" + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Fetch And Rebase + run: | + git fetch https://github.com/torvalds/linux master + git rebase FETCH_HEAD + + - name: Regenerate Config + run: | + export KBUILD_BUILD_USER="neil" && export KBUILD_BUILD_HOST="kernel-build" + make wsl_defconfig && make savedefconfig + cp defconfig arch/x86/configs/wsl_defconfig + git add . && git commit --amend --no-edit + + - name: Push + run: | + git push https://github.com/neilchetty/wsl-kernel -f diff --git a/.gitignore b/.gitignore index 98274e1160d7b1..cac1f0f5fb21da 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # Normal rules (sorted alphabetically) # .* +!.github *.a *.asn1.[ch] *.bin