Skip to content

Commit

Permalink
Create build_main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
netflexs authored Sep 26, 2024
1 parent 075dbe9 commit bdc9e3b
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build Linux Kernel

on:
# Automatic triggers
push:
branches:
- main # Adjust this to your main branch
pull_request:
branches:
- main

# Manual trigger
workflow_dispatch:

jobs:
build:
name: Build Kernel
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev
- name: Build Kernel
run: |
make defconfig
make -j$(nproc)
- name: Archive the build artifacts
run: |
tar -czvf kernel-build.tar.gz arch/x86/boot/bzImage
continue-on-error: true

- name: Upload Kernel Artifact
uses: actions/upload-artifact@v3
with:
name: kernel-build
path: kernel-build.tar.gz

release:
name: Release Kernel
needs: build
runs-on: ubuntu-latest

if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: kernel-build

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Kernel Build v${{ github.run_number }}
draft: false
prerelease: false

- name: Upload Kernel to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: kernel-build.tar.gz
asset_name: kernel-build.tar.gz
asset_content_type: application/gzip

0 comments on commit bdc9e3b

Please sign in to comment.