-
Notifications
You must be signed in to change notification settings - Fork 17
153 lines (132 loc) · 5.34 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
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
name: Build nightly images
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5' # Run every friday at midnight
env:
KERNEL_BRANCH: next
jobs:
build-image:
strategy:
matrix:
version: ["next", "default"]
runs-on: ubuntu-latest
steps:
- name: Check out build configurations
uses: actions/checkout@v4
- name: Substitute placeholders in configs
run: |
find . -type f -name "*.cfg" -exec sed -i "s|HOME|$(echo $HOME)|;s|NPROC|$(nproc)|" {} +
- name: Install pmbootstrap from git
run: |
git clone --depth=1 https://gitlab.com/postmarketOS/pmbootstrap/
mkdir -p ~/.local/bin
ln -s "$PWD/pmbootstrap/pmbootstrap.py" ~/.local/bin/pmbootstrap
pmbootstrap --version
- name: Set up pmaports
run: |
echo -e '\n\n' | pmbootstrap init || true
cd ~/.local/var/pmbootstrap/cache_git/pmaports
git remote add sm7150 https://github.com/sm7150-mainline/pmaports.git
DEFAULT_BRANCH=$(git remote show sm7150 | awk '/HEAD branch/ {print $NF}')
git fetch sm7150 $DEFAULT_BRANCH
git reset --hard sm7150/$DEFAULT_BRANCH
- name: Check kernel branch
if: matrix.version == 'default'
run: |
DEFAULT_BRANCH=$(curl -s https://api.github.com/repos/sm7150-mainline/linux | jq -r '.default_branch')
echo "Default branch is $DEFAULT_BRANCH"
echo "KERNEL_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV
- name: Clone kernel sources
run: |
git clone https://github.com/sm7150-mainline/linux.git --single-branch --branch ${{ env.KERNEL_BRANCH }} --depth 1
- name: Choose any SM7150 device in pmbootstrap to build kernel
run: |
cp xiaomi-davinci.cfg ~/.config/pmbootstrap.cfg
- name: Compile kernel with envkernel
run: |
cd linux
shopt -s expand_aliases
source ../pmbootstrap/helpers/envkernel.sh
make defconfig sm7150.config
make -j$(nproc)
pmbootstrap build --envkernel linux-postmarketos-qcom-sm7150
- name: Create artifact directory
run: |
mkdir out
- name: Build xiaomi-davinci
run: |
cp xiaomi-davinci.cfg ~/.config/pmbootstrap.cfg
pmbootstrap install --password 147147
pmbootstrap export
cp /tmp/postmarketOS-export/boot.img out/boot-xiaomi-davinci.img
cp /tmp/postmarketOS-export/xiaomi-davinci.img out/rootfs-xiaomi-davinci.img
xz -T0 -9e -v out/rootfs-xiaomi-davinci.img
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-davinci-${{ env.KERNEL_BRANCH }}
path: out/*-davinci.img*
retention-days: 7
- name: Build xiaomi-surya
run: |
cp xiaomi-surya.cfg ~/.config/pmbootstrap.cfg
pmbootstrap install --password 147147
pmbootstrap export
cp /tmp/postmarketOS-export/boot.img out/boot-xiaomi-surya.img
cp /tmp/postmarketOS-export/xiaomi-surya.img out/rootfs-xiaomi-surya.img
xz -T0 -9e -v out/rootfs-xiaomi-surya.img
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-surya-${{ env.KERNEL_BRANCH }}
path: out/*-surya.img*
retention-days: 7
- name: Build xiaomi-sweet
run: |
cp xiaomi-sweet.cfg ~/.config/pmbootstrap.cfg
pmbootstrap install --password 147147
pmbootstrap export
cp /tmp/postmarketOS-export/boot.img out/boot-xiaomi-sweet.img
cp /tmp/postmarketOS-export/xiaomi-sweet.img out/rootfs-xiaomi-sweet.img
xz -T0 -9e -v out/rootfs-xiaomi-sweet.img
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-sweet-${{ env.KERNEL_BRANCH }}
path: out/*-sweet.img*
retention-days: 7
- name: Build xiaomi-sweet_k6a
run: |
cp xiaomi-sweet_k6a.cfg ~/.config/pmbootstrap.cfg
pmbootstrap install --password 147147
pmbootstrap export
cp /tmp/postmarketOS-export/boot.img out/boot-xiaomi-sweeet_k6a.img
cp /tmp/postmarketOS-export/xiaomi-sweet_k6a.img out/rootfs-xiaomi-sweet_k6a.img
xz -T0 -9e -v out/rootfs-xiaomi-sweet_k6a.img
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-sweet_k6a-${{ env.KERNEL_BRANCH }}
path: out/*-sweet_k6a.img*
retention-days: 7
- name: Build xiaomi-toco
run: |
cp xiaomi-toco.cfg ~/.config/pmbootstrap.cfg
pmbootstrap install --password 147147
pmbootstrap export
cp /tmp/postmarketOS-export/boot.img out/boot-xiaomi-toco.img
cp /tmp/postmarketOS-export/xiaomi-toco.img out/rootfs-xiaomi-toco.img
xz -T0 -9e -v out/rootfs-xiaomi-toco.img
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-toco-${{ env.KERNEL_BRANCH }}
path: out/*-toco.img*
retention-days: 7