Skip to content

Commit 914f31b

Browse files
ci: Introduce build tools v3
1 parent f35ca4e commit 914f31b

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed

.github/workflows/rel.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build Kernel Release CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*/release'
7+
8+
env:
9+
GH_TOKEN: ${{ github.token }}
10+
TZ: ${{ secrets.TZ }}
11+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
12+
13+
jobs:
14+
build-gki-clang:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Set up environment
19+
id: setup-env
20+
run: |
21+
sudo apt update -y
22+
sudo apt install -y repo elfutils libarchive-tools
23+
24+
- name: Initialize repo
25+
id: init-repo
26+
run: repo init -u https://github.com/DarknessKiller/android_kernel_manifest.git -b overdose-gki-5.10 --depth=1
27+
28+
- name: Use release repo
29+
id: use-release-repo
30+
run: |
31+
sed -i "s#revision=\"android12-5\.10-2023-04_r8/release\"#revision=\"$BRANCH_NAME\"#" .repo/manifests/default.xml
32+
cat .repo/manifests/default.xml
33+
34+
- name: Repo sync
35+
id: repo-sync
36+
run: repo sync --no-tags --no-clone-bundle -j$(nproc --all)
37+
38+
- name: KernelSU sync
39+
id: kernelsu-sync
40+
run: |
41+
cd common
42+
git submodule update --init --recursive
43+
44+
- name: Fetch SlimLLVM
45+
id: fetch-slimllvm
46+
run: |
47+
rm -rf prebuilts-master/clang/host/linux-x86/clang-r416183b
48+
git clone https://gitlab.com/MRDarknessKiller/slimllvm.git -b 14 --depth=1 prebuilts-master/clang/host/linux-x86/clang-r416183b
49+
50+
- name: Configure build environment
51+
id: configure-build
52+
run: |
53+
echo "CURRENT_EPOCH=$(date +%s)" >> $GITHUB_OUTPUT
54+
sed -i 's/build-user/mrdarknessk/g; s/build-host/github-actions/g; s#TZ=UTC#TZ='"$TZ"'#g' build/_setup_env.sh
55+
sed -i 's/KBUILD_BUILD_TIMESTAMP="$(date -d @${SOURCE_DATE_EPOCH})"/KBUILD_BUILD_TIMESTAMP="$(date -d @${GITHUB_OUTPUT})"/g' build/_setup_env.sh
56+
57+
- name: Build kernel
58+
id: build-kernel
59+
run: |
60+
LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64.overdose build/build.sh
61+
62+
- name: Create zip
63+
id: create-zip
64+
env:
65+
CURRENT_EPOCH: ${{ steps.configure-build.outputs.CURRENT_EPOCH }}
66+
run: |
67+
cp out/android12-5.10/dist/Image ak3/
68+
cd ak3/ && zip -r9 "OverdoseGKI-5.10-$(date -d @$CURRENT_EPOCH '+%Y%m%d-%H%M').zip" * -x .git README.md ./*/placeholder
69+
70+
- name: Upload artifact
71+
id: upload-artifact
72+
uses: actions/upload-artifact@main
73+
with:
74+
name: release
75+
path: ak3/*.zip
76+
77+
publish-release:
78+
needs: [build-gki-clang]
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
- name: Checkout code
83+
id: checkout-code
84+
uses: actions/checkout@main
85+
86+
- name: Download artifact
87+
id: download-artifact
88+
uses: actions/download-artifact@main
89+
with:
90+
name: release
91+
path: ${{ github.workspace }}
92+
93+
- name: Release tag
94+
id: release-tag
95+
run: echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
96+
97+
- name: Create release
98+
id: create-release
99+
run: gh release create ${{ env.TAG_NAME }} --generate-notes -p *.zip
100+
101+
- name: Release check
102+
id: release-check
103+
run: gh release list -L 1 > list
104+
105+
- name: Prepare release message
106+
id: prepare-release-message
107+
run: gh release view $(cat list | awk '{ print substr( $0, 1, length($0)-45 ) }') > release-text

.github/workflows/stag.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build Kernel Staging CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*/staging'
7+
8+
env:
9+
TZ: ${{ secrets.TZ }}
10+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
11+
jobs:
12+
build-gki-clang:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Set up environment
17+
id: setup-env
18+
run: |
19+
sudo apt update -y
20+
sudo apt install -y repo elfutils libarchive-tools
21+
22+
- name: Initialize repo
23+
id: init-repo
24+
run: repo init -u https://github.com/DarknessKiller/android_kernel_manifest.git -b overdose-gki-5.10 --depth=1
25+
26+
- name: Use staging repo
27+
id: use-staging-repo
28+
run: |
29+
sed -i "s#revision=\"android12-5\.10-2023-04_r8/release\"#revision=\"$BRANCH_NAME\"#" .repo/manifests/default.xml
30+
cat .repo/manifests/default.xml
31+
32+
33+
- name: Repo sync
34+
id: repo-sync
35+
run: repo sync --no-tags --no-clone-bundle -j$(nproc --all)
36+
37+
- name: KernelSU sync
38+
id: kernelsu-sync
39+
run: |
40+
cd common
41+
git submodule update --init --recursive
42+
43+
- name: Fetch SlimLLVM
44+
id: fetch-slimllvm
45+
run: |
46+
rm -rf prebuilts-master/clang/host/linux-x86/clang-r416183b
47+
git clone https://gitlab.com/MRDarknessKiller/slimllvm.git -b 14 --depth=1 prebuilts-master/clang/host/linux-x86/clang-r416183b
48+
49+
- name: Configure build environment
50+
id: configure-build
51+
run: |
52+
echo "CURRENT_EPOCH=$(date +%s)" >> $GITHUB_OUTPUT
53+
sed -i 's/build-user/mrdarknessk/g; s/build-host/github-actions/g; s#TZ=UTC#TZ='"$TZ"'#g' build/_setup_env.sh
54+
sed -i 's/KBUILD_BUILD_TIMESTAMP="$(date -d @${SOURCE_DATE_EPOCH})"/KBUILD_BUILD_TIMESTAMP="$(date -d @${GITHUB_OUTPUT})"/g' build/_setup_env.sh
55+
56+
- name: Build kernel
57+
id: build-kernel
58+
run: |
59+
LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64.overdose build/build.sh
60+
61+
- name: Create zip
62+
id: create-zip
63+
env:
64+
CURRENT_EPOCH: ${{ steps.configure-build.outputs.CURRENT_EPOCH }}
65+
run: |
66+
cp out/android12-5.10/dist/Image ak3/
67+
echo "CURRENT_DATE=$(date -d @${CURRENT_EPOCH} '+%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
68+
69+
- name: Upload artifact
70+
id: upload-artifact
71+
env:
72+
CURRENT_DATE: ${{ steps.create-zip.outputs.CURRENT_DATE }}
73+
uses: actions/upload-artifact@main
74+
with:
75+
name: OverdoseGKI-5.10-${{ env.CURRENT_DATE }}
76+
path: |
77+
ak3/*
78+
!ak3/.git
79+
!ak3/placeholder
80+
!ak3/.gitignore
81+
!ak3/README.md

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,6 @@ x509.genkey
157157

158158
# Documentation toolchain
159159
sphinx_*/
160+
161+
# Build Kernel CI
162+
!.github

0 commit comments

Comments
 (0)