forked from immortalwrt/immortalwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (198 loc) · 7.96 KB
/
openwrt_dev.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: OpenWrt Test CI
on:
push:
branches:
- master
# tags:
# - 'v*'
# schedule:
# - cron: 0 20 * * *
#release:
# types: [published]
jobs:
build_openwrt_glibc:
name: Build OpenWrt OpenWrt-24.10 glibc dev firmware
runs-on: ubuntu-24.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Set workspace
run: |
sudo mkdir -p -m 777 /mnt/openwrt
echo "WORK_PATH=/mnt/openwrt" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Set variables
run: |
sudo -E timedatectl set-timezone Asia/Shanghai
- name: Configure compilation environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \
g++-multilib git libgnutls28-dev gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev \
libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev \
libncurses-dev libpython3-dev libreadline-dev libssl-dev libtool lld llvm lrzsz genisoimage msmtp \
nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip python3-ply \
python3-docutils python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig \
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev zstd yasm
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
df -h
- name: Move Build Path
run: |
cp -r ./. ${{ env.WORK_PATH }}/
- name: Update feeds
working-directory: ${{ env.WORK_PATH }}
run: |
./tool.sh feed
- name: Generate configuration file
working-directory: ${{ env.WORK_PATH }}
run: |
rm -f ./.config*
cp ./configs/base_glibc_config ./.config
make defconfig
- name: Make download
working-directory: ${{ env.WORK_PATH }}
run: |
make download -j8 || make download -j1 V=s
rm -rf $(find ./dl/ -size -1024c)
df -h
- name: Compile firmware
run: |
cd ${{ env.WORK_PATH }}
make -j$(nproc) || make -j1 V=s
- name: Clean Build Files
working-directory: ${{ env.WORK_PATH }}
run: |
rm -rf ./staging_dir
rm -rf ./build_dir
- name: Prepare artifact
working-directory: ${{ env.WORK_PATH }}
run: |
mkdir -p ./artifact/firmware
mkdir -p ./artifact/package
mkdir -p ./artifact/buildinfo
rm -rf $(find ./bin/targets/ -type d -name "packages")
cp -rf $(find ./bin/targets/ -type f -name "immortalwrt-*") ./artifact/firmware/
cp -rf $(find ./bin/targets/ -type f -name "sha256sums") ./artifact/firmware/
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/
- name: Clean Bin Files
working-directory: ${{ env.WORK_PATH }}
run: |
rm -rf ./bin
- name: Deliver buildinfo
uses: actions/upload-artifact@v4
with:
name: OpenWrt_buildinfo_glic
path: ${{ env.WORK_PATH }}/artifact/buildinfo/
- name: Deliver package
uses: actions/upload-artifact@v4
with:
name: OpenWrt_package_glic
path: ${{ env.WORK_PATH }}/artifact/package/
- name: Deliver firmware
uses: actions/upload-artifact@v4
with:
name: OpenWrt_firmware_glic
path: ${{ env.WORK_PATH }}/artifact/firmware/
build_openwrt_musl:
name: Build OpenWrt OpenWrt-24.10 musl dev firmware
runs-on: ubuntu-24.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Set workspace
run: |
sudo mkdir -p -m 777 /mnt/openwrt
echo "WORK_PATH=/mnt/openwrt" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Set variables
run: |
sudo -E timedatectl set-timezone Asia/Shanghai
- name: Configure compilation environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \
g++-multilib git libgnutls28-dev gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev \
libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev \
libncurses-dev libpython3-dev libreadline-dev libssl-dev libtool lld llvm lrzsz genisoimage msmtp \
nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip python3-ply \
python3-docutils python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig \
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev zstd yasm
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
df -h
- name: Move Build Path
run: |
cp -r ./. ${{ env.WORK_PATH }}/
- name: Update feeds
working-directory: ${{ env.WORK_PATH }}
run: |
./tool.sh feed
- name: Generate configuration file
working-directory: ${{ env.WORK_PATH }}
run: |
rm -f ./.config*
cp ./configs/base_musl_config ./.config
make defconfig
- name: Make download
working-directory: ${{ env.WORK_PATH }}
run: |
make download -j8 || make download -j1 V=s
rm -rf $(find ./dl/ -size -1024c)
df -h
- name: Compile firmware
run: |
cd ${{ env.WORK_PATH }}
make -j$(nproc) || make -j1 V=s
- name: Clean Build Files
working-directory: ${{ env.WORK_PATH }}
run: |
rm -rf ./staging_dir
rm -rf ./build_dir
- name: Prepare artifact
working-directory: ${{ env.WORK_PATH }}
run: |
mkdir -p ./artifact/firmware
mkdir -p ./artifact/package
mkdir -p ./artifact/buildinfo
rm -rf $(find ./bin/targets/ -type d -name "packages")
cp -rf $(find ./bin/targets/ -type f -name "immortalwrt-*") ./artifact/firmware/
cp -rf $(find ./bin/targets/ -type f -name "sha256sums") ./artifact/firmware/
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/
- name: Clean Bin Files
working-directory: ${{ env.WORK_PATH }}
run: |
rm -rf ./bin
- name: Deliver buildinfo
uses: actions/upload-artifact@v4
with:
name: OpenWrt_buildinfo_musl
path: ${{ env.WORK_PATH }}/artifact/buildinfo/
- name: Deliver package
uses: actions/upload-artifact@v4
with:
name: OpenWrt_package_musl
path: ${{ env.WORK_PATH }}/artifact/package/
- name: Deliver firmware
uses: actions/upload-artifact@v4
with:
name: OpenWrt_firmware_musl
path: ${{ env.WORK_PATH }}/artifact/firmware/
push_msg:
name: push weixing msg
needs: [build_openwrt_glibc, build_openwrt_musl]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Push Msg
run: |
sh .github/push.sh ${{ secrets.CORPID }} ${{ secrets.CORPSECRET }} ${{ secrets.AGENTID }} "x86_64" "dev on ${{ github.ref_name }}"