forked from sm7150-mainline/nightly-builds
-
Notifications
You must be signed in to change notification settings - Fork 5
132 lines (115 loc) · 4.8 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
name: Build nightly images
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5' # Run every friday at midnight
jobs:
build-image:
strategy:
matrix:
version: ["next"]
runs-on: ubuntu-latest
steps:
- name: Check out build configurations
uses: actions/checkout@v4
- name: Substitute placeholders in configs
run: |
#sudo apt update
#sudo apt-get install -y gcc-aarch64-linux-gnu
#sudo apt-get install -y binutils-aarch64-linux-gnu
find . -type f -name "*.cfg" -exec sed -i "s|HOME|$(echo $HOME)|;s|NPROC|$(nproc)|" {} +
echo "KERNEL_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV
- name: Install pmbootstrap from git
run: |
git clone --depth=1 https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
#py3-dt-schema only avail for edge channel
sed -i '/py3-dt-schema/d' pmbootstrap/helpers/envkernel.sh
mkdir -p ~/.local/bin
ln -s "$PWD/pmbootstrap/pmbootstrap.py" ~/.local/bin/pmbootstrap
pmbootstrap --version
- name: Set up pmaports
run: |
echo -e '\nedge\nfairphone\nfp4\n\n\nphosh\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' | pmbootstrap init || true
# Since v23.06 do not have testing folder, create it.
mkdir -p ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing
cd ~/.local/var/pmbootstrap/cache_git/pmaports
echo "merging local pmaport device files to upstream aport...."
git config user.name "Your Name"
git config user.email "you@example.com"
git remote add 99degree https://github.com/99degree/pmaports.git
git fetch origin master
git fetch 99degree next
#git fetch 99degree v23.06
#Currently edge channel is not working...
git checkout origin/master -f
git merge -m "merge upstreaam master with local changes" 99degree/next
#git checkout 99degree/v23.06 -f
git clean -fdx
- name: Choose any SM7125 device in pmbootstrap to build kernel
run: |
cp xiaomi-miatoll.cfg ~/.config/pmbootstrap_v3.cfg
- name: Clone kernel sources
run: |
git clone https://github.com/99degree/linux.git --single-branch --branch ${{ matrix.version }} --depth 1
- name: Compile kernel with envkernel
run: |
# there are many intermediate file generated and deleted by gcc,
# use tmpfs to hold and speed up the process.
# in case pmbootstrap or envkernel.sh have such thing this hack can removed.
# sounds like running mount non-root not allowed
# unshare is not working as well
# unshare -m
# mount -t tmpfs none ~/.local/var/pmbootstrap/chroot_native/tmp
# mount -t tmpfs none /tmp
cd linux
shopt -s expand_aliases
source ../pmbootstrap/helpers/envkernel.sh
# fetch local config
git fetch origin config
git branch config FETCH_HEAD
git checkout config -- arch/arm64/configs/sm71xx-xiaomi.config
# apply local config
make defconfig sm71xx-xiaomi.config
# make it
make -j$(nproc)
#to failsafe for private build...
pmbootstrap build --envkernel linux-postmarketos-qcom-sm7125
- name: Create artifact directory
run: |
mkdir out
mkdir out_raw
- name: Build xiaomi-miatoll
run: |
#cp xiaomi-miatoll.cfg ~/.config/pmbootstrap.cfg
#pmbootstrap config boot_size 256
pmbootstrap update --non-existing
pmbootstrap build adbd-linux
pmbootstrap build firmware-xiaomi-miatoll
pmbootstrap chroot apk add qcam
pmbootstrap -v install --password 147147 --no-sparse --split
#pmbootstrap chroot apk add qcam
pmbootstrap export out_raw/
ls -la out_raw/
cp -R -u -p -L out_raw/* out/ | true
# pmbootstrap export do not work atm, cp manually
ls -la $HOME/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/*
cp $HOME/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/* out/
# zip them all
xz -T0 -9e -v out/*.img
ls -la out/
echo -e "n\nn\ny\n" | pmbootstrap zap
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: xiaomi-miatoll-${{ matrix.version }}
path: out/*
retention-days: 15
- name: Release nightly
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: nightly
tag_name: nightly
files: out/xiaomi-miatoll-${{ matrix.version }}
fail_on_unmatched_files: true