forked from Pzqqt/android_kernel_xiaomi_marble
-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (91 loc) · 3.77 KB
/
kernel.yml
File metadata and controls
109 lines (91 loc) · 3.77 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This is a basic workflow to help you get started with Actions
name: Build kernel
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Build kernel
runs-on: ubuntu-latest
container: quay.io/droidian/build-essential:current-amd64
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
ref: melt-rebase
- name: Update & install dependencies
run: |
apt update
apt install zip curl aria2 git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison build-essential dpkg-dev findutils android-platform-prebuilts-python-linux-x86-2.7.5 bc rsync kmod cpio bison flex libssl-dev binutils-aarch64-linux-gnu lz4 -y
aria2c -x 10 -s 10 -j 10 https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.3/LLVM-20.1.3-Linux-X64.tar.xz -o clang.tar.xz -d /
mkdir /clang
tar -xf /clang.tar.xz -C /clang
mv /clang/*/* /clang/
mkdir -p /android-kernel/
git clone https://android.googlesource.com/kernel/build -b android-12.1.0_r0.40 /android-kernel/build
- name: Patch kernel
run: |
curl https://github.com/Halhadus/android_kernel_xiaomi_marble/compare/melt-rebase...Pzqqt:android_kernel_xiaomi_marble:melt-rebase-hyperos.diff | git apply --check --ignore-space-change --ignore-whitespace
curl https://github.com/Halhadus/android_kernel_xiaomi_marble/compare/melt-rebase...Pzqqt:android_kernel_xiaomi_marble:melt-rebase-hyperos.diff | git apply --ignore-space-change --ignore-whitespace
git apply --check --ignore-space-change --ignore-whitespace <./lxcbuild/lxc_support.diff
git apply --ignore-space-change --ignore-whitespace <./lxcbuild/lxc_support.diff
cp ./lxcbuild/stock_gki_defconfig arch/arm64/configs/
- name: Build kernel
run: |
export PATH=/opt/android/prebuilts/python/2.7.5/bin:$PATH
./build_lxc.sh -- Image
cd /outmelt
zip -r melt-kernel.zip .
- name: Move package to out directory
run: |
mkdir /out
cp /outmelt/melt-kernel.zip /out/
ls /out
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: kernel
path: /out/melt-kernel.zip
if-no-files-found: error
retention-days: 1
prepare:
runs-on: ubuntu-latest
name: Create GitHub release
needs: build
steps:
- name: Delete old latest-kernel release
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
delete_release: true
tag_name: latest-kernel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag latest-kernel
uses: tvdias/github-tagger@v0.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: latest-kernel
publish:
runs-on: ubuntu-latest
needs: prepare
name: Publish kernel
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: out
- name: Create latest-kernel release
uses: softprops/action-gh-release@v2.2.1
with:
files: out/kernel/*
tag_name: latest-kernel
draft: false
prerelease: false