This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
211 lines (195 loc) · 8.76 KB
/
kernel.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Kernel Build CI
on:
push:
env:
BOT_MSG_URL: ${{ secrets.TG_BOT_MSG_URL }}
CHAT_ID: ${{ secrets.TG_CHAT_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }}
GITHUB_EMAIL: ${{ secrets.EMAIL }}
GITHUB_USER: ${{ secrets.USERNAME }}
jobs:
bot-notify-ci:
runs-on: ubuntu-latest
steps:
- name: Send message
run: curl -s -X POST ${{ env.BOT_MSG_URL }} -d chat_id=${{ env.CHAT_ID }} -d "disable_web_page_preview=true" -d "parse_mode=html" -d text="CI kernel build triggered for <b>OPlus sm8350 Devices</b>"
build-lemonade-gcc:
needs: [bot-notify-ci]
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Setup Pre-requisites
run: sudo dnf install gcc clang lld repo bc flex openssl-devel wget tar zstd bsdtar file rsync zip -y
- name: Repo sync
run: |
repo init -u https://github.com/mvaisakh/android_kernel_manifest -b eva-oneplus-5.4 --depth=1
repo sync --no-tags --no-clone-bundle -j$(nproc --all)
- name: GCC Build
run: |
sed -i s/build-user/mvaisakh/g build/_setup_env.sh
sed -i s/build-host/statixos/g build/_setup_env.sh
BUILD_CONFIG=kernel/msm-5.4/build.config.lemonade VARIANT=qgki BUILTIN=1 COMPILER=gcc GCC_LTO=1 GRAPHITE=1 PGO=1 SKIP_MRPROPER=1 BUILD_KERNEL=1 build/build.sh
- name: Create zip
run: |
cp out/msm-5.4-lahaina-qgki/dist/Image ak3/
cat out/msm-5.4-lahaina-qgki/dist/*.dtb > ak3/dtb
cp out/msm-5.4-lahaina-qgki/dist/dtbo.img ak3/
cd ak3/ && zip -r9 eva-lemonade-$(/bin/date -u '+%d%m%Y%I%M')-gcc.zip * -x .git README.md ./*/placeholder
cd ../
- uses: actions/upload-artifact@main
with:
name: lemonade-release-zip
path: ak3/*.zip
- name: Push kernel
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
git clone https://"${GITHUB_USER}":"${PUSH_TOKEN}"@github.com/mvaisakh/android_device_oneplus_lemonade-kernel lemonade-kernel -b tm-gcc
cp out/msm-5.4-lahaina-qgki/dist/* lemonade-kernel
cd lemonade-kernel
f="$(git rev-parse --git-dir)/hooks/commit-msg"; curl -o "$f" https://review.statixos.com/tools/hooks/commit-msg ; chmod +x "$f"
git add .
git commit -m "lemonade-kernel: update prebuilts $(/bin/date -u '+%d%m%Y%I%M')" -m "version: $(strings Image | grep 'Linux Version 5')"
git push
build-lemonade-gcc-profiling:
needs: [bot-notify-ci]
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Setup Pre-requisites
run: sudo dnf install gcc clang lld repo bc flex openssl-devel wget tar zstd bsdtar file rsync zip -y
- name: Repo sync
run: |
repo init -u https://github.com/mvaisakh/android_kernel_manifest -b eva-oneplus-5.4 --depth=1
repo sync --no-tags --no-clone-bundle -j$(nproc --all)
- name: GCC Build
run: |
sed -i s/build-user/mvaisakh/g build/_setup_env.sh
sed -i s/build-host/statixos/g build/_setup_env.sh
BUILD_CONFIG=kernel/msm-5.4/build.config.lemonade VARIANT=qgki BUILTIN=1 COMPILER=gcc GCC_LTO=1 GRAPHITE=1 GCOV_PROFILE=1 SKIP_MRPROPER=1 BUILD_KERNEL=1 build/build.sh
- name: Create zip
run: |
cp out/msm-5.4-lahaina-qgki/dist/Image ak3/
cat out/msm-5.4-lahaina-qgki/dist/*.dtb > ak3/dtb
cp out/msm-5.4-lahaina-qgki/dist/dtbo.img ak3/
cd ak3/ && zip -r9 eva-lemonade-$(/bin/date -u '+%d%m%Y%I%M')-gcc-profiling.zip * -x .git README.md ./*/placeholder
cd ../
- name: Create profiling tar
run: |
tar -cf eva-lemonade-gcov-gcno-$(/bin/date -u '+%d%m%Y%I%M').xz $(find /home/runner/work/oneplus9pro/oneplus9pro/out/msm-5.4-lahaina-qgki/kernel/msm-5.4/ | grep gcno)
- uses: actions/upload-artifact@main
with:
name: lemonade-profile-zip
path: |
ak3/*.zip
*.xz
build-martini-gcc:
needs: [bot-notify-ci]
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Setup Pre-requisites
run: sudo dnf install gcc clang lld repo bc flex openssl-devel wget tar zstd bsdtar file rsync zip -y
- name: Repo sync
run: |
repo init -u https://github.com/mvaisakh/android_kernel_manifest -b eva-oneplus-5.4 --depth=1
repo sync --no-tags --no-clone-bundle -j$(nproc --all)
- name: GCC Build
run: |
sed -i s/build-user/mvaisakh/g build/_setup_env.sh
sed -i s/build-host/statixos/g build/_setup_env.sh
BUILD_CONFIG=kernel/msm-5.4/build.config.martini VARIANT=qgki BUILTIN=1 COMPILER=gcc GCC_LTO=1 GRAPHITE=1 SKIP_MRPROPER=1 BUILD_KERNEL=1 build/build.sh
- name: Create zip
run: |
cp out/msm-5.4-lahaina-qgki/dist/Image ak3/
cat out/msm-5.4-lahaina-qgki/dist/*.dtb > ak3/dtb
cp out/msm-5.4-lahaina-qgki/dist/dtbo.img ak3/
cd ak3/ && zip -r9 eva-martini-$(/bin/date -u '+%d%m%Y%I%M')-gcc.zip * -x .git README.md ./*/placeholder
cd ../
- uses: actions/upload-artifact@main
with:
name: martini-release-zip
path: ak3/*.zip
- name: Push kernel
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
git clone https://"${GITHUB_USER}":"${PUSH_TOKEN}"@github.com/mvaisakh/android_device_oneplus_martini-kernel martini-kernel -b tm-gcc
cp out/msm-5.4-lahaina-qgki/dist/* martini-kernel
cd martini-kernel
f="$(git rev-parse --git-dir)/hooks/commit-msg"; curl -o "$f" https://review.statixos.com/tools/hooks/commit-msg ; chmod +x "$f"
git add .
git commit -m "martini-kernel: update prebuilts $(/bin/date -u '+%d%m%Y%I%M')" -m "version: $(strings Image | grep 'Linux Version 5')"
git push
build-martini-gcc-profiling:
needs: [bot-notify-ci]
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Setup Pre-requisites
run: sudo dnf install gcc clang lld repo bc flex openssl-devel wget tar zstd bsdtar file rsync zip -y
- name: Repo sync
run: |
repo init -u https://github.com/mvaisakh/android_kernel_manifest -b eva-oneplus-5.4 --depth=1
repo sync --no-tags --no-clone-bundle -j$(nproc --all)
- name: GCC Build
run: |
sed -i s/build-user/mvaisakh/g build/_setup_env.sh
sed -i s/build-host/statixos/g build/_setup_env.sh
BUILD_CONFIG=kernel/msm-5.4/build.config.martini VARIANT=qgki BUILTIN=1 COMPILER=gcc GCC_LTO=1 GRAPHITE=1 GCOV_PROFILE=1 SKIP_MRPROPER=1 BUILD_KERNEL=1 build/build.sh
- name: Create zip
run: |
cp out/msm-5.4-lahaina-qgki/dist/Image ak3/
cat out/msm-5.4-lahaina-qgki/dist/*.dtb > ak3/dtb
cp out/msm-5.4-lahaina-qgki/dist/dtbo.img ak3/
cd ak3/ && zip -r9 eva-martini-$(/bin/date -u '+%d%m%Y%I%M')-gcc-profiling.zip * -x .git README.md ./*/placeholder
cd ../
- name: Create profiling tar
run: |
tar -cf eva-martini-gcov-gcno-$(/bin/date -u '+%d%m%Y%I%M').xz $(find /home/runner/work/oneplus9pro/oneplus9pro/out/msm-5.4-lahaina-qgki/kernel/msm-5.4/ | grep gcno)
- uses: actions/upload-artifact@main
with:
name: martini-profile-zip
path: |
ak3/*.zip
*.xz
publish-release:
needs: [build-lemonade-gcc,build-martini-gcc]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restoring artifacts
uses: actions/download-artifact@main
with:
path: ${{ github.workspace }}
- name: Release Tag
id: release_tag
run: echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
- name: Create Release
run: gh release create ${{ env.TAG_NAME }} --generate-notes -p */*.zip
- name: Release Check
run: gh release list -L 1 > list
- name: Prepare release message
run: gh release view $(cat list | awk '{ print substr( $0, 1, length($0)-45 ) }') > release-text
- name: Send message
run: curl -s -X POST ${{ env.BOT_MSG_URL }} -d chat_id=${{ env.CHAT_ID }} -d "disable_web_page_preview=true" -d "parse_mode=html" -d text="<b>New build for OnePlus 9 Series</b> %0A$(cat release-text | sed '1d;3d;4d;6d;7d;9d;10d;11d;12d;13d;14d;15d;16d;17d;')"
publish-release-profiling:
needs: [build-lemonade-gcc-profiling,build-martini-gcc-profiling]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restoring artifacts
uses: actions/download-artifact@main
with:
name: profile-zip
path: ${{ github.workspace }}
- name: Profiling Tag
id: profile_tag
run: echo "TAG_NAME_PROFILING=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
- name: Create Release
run: gh release create "${{ env.TAG_NAME_PROFILING }}-profiling" --generate-notes -p */*.zip *.xz