forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.14 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build Linux Kernel with TCC
on:
# Automatic triggers
push:
branches:
- main
pull_request:
branches:
- main
# Manual trigger
workflow_dispatch:
jobs:
build:
name: Build Kernel with TCC
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 tcc
- name: Configure Kernel
run: |
make defconfig
- name: Build Kernel with TCC
run: |
# Set TCC as the compiler
export CC=tcc
export CFLAGS="-O2" # Enable optimization (you can adjust the level for tuning performance)
# Compile kernel with TCC
make -j$(nproc) # Compile using all available CPU cores
- 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
steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: kernel-build
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }} # Auto-generate tag using the 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