46
46
- name : Run Make
47
47
run : |
48
48
chmod +x ${{ github.workspace }}/build_clash.sh
49
- docker run -i --name openwrt-sdk-${{ matrix.arch }}-${{ matrix.version }} --user root -v ${{ github.workspace }}/build_clash.sh:/build_clash.sh openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} /build_clash.sh
49
+ mkdir -p ${{ github.workspace }}/openclash
50
+ docker run -i --name openwrt-sdk-${{ matrix.arch }}-${{ matrix.version }} --user root -v ${{ github.workspace }}/build_clash.sh:/build_clash.sh -v ${{ github.workspace }}/openclash/:/openclash/ openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} /build_clash.sh
50
51
52
+ - uses : actions/upload-artifact@v3
53
+ with :
54
+ name : openclash-${{ matrix.arch }}-${{ matrix.version }}
55
+ path : openclash
51
56
52
57
build_passwall :
53
58
strategy :
@@ -204,41 +209,62 @@ jobs:
204
209
version : [master, 22.03-SNAPSHOT, 23.05-SNAPSHOT, 22.03.5]
205
210
arch : [x86-64, rockchip-armv8]
206
211
if : ${{ always() }}
207
- needs : [build_passwall, build_theme_argon, build_luci_app_netdata]
212
+ needs : [build_passwall, build_theme_argon, build_luci_app_netdata, build_openclash ]
208
213
name : Build Image for OpenWRT-${{ matrix.arch }}-${{ matrix.version }}
209
214
runs-on : ubuntu-latest
210
- container :
211
- image : openwrt/imagebuilder:${{ matrix.arch }}-${{ matrix.version }}
212
- options : --user root
215
+ # container:
216
+ # image: openwrt/imagebuilder:${{ matrix.arch }}-${{ matrix.version }}
217
+ # options: --user root
213
218
defaults :
214
219
run :
215
220
shell : bash
216
221
steps :
222
+ - name : Maximize build space
223
+ uses : easimon/maximize-build-space@v8
224
+ with :
225
+ root-reserve-mb : 1024
226
+ swap-size-mb : 1024
227
+ remove-dotnet : ' true'
228
+ remove-android : ' true'
229
+ remove-haskell : ' true'
230
+ remove-codeql : ' true'
231
+ remove-docker-images : ' true'
232
+
233
+ - name : Checkout
234
+ uses : actions/checkout@v2
235
+ with :
236
+ fetch-depth : 0
237
+
217
238
- uses : actions/download-artifact@v3
218
239
with :
219
240
name : passwall-${{ matrix.arch }}-${{ matrix.version }}
220
241
- uses : actions/download-artifact@v3
221
242
with :
222
243
name : luci-theme-argon-${{ matrix.arch }}-${{ matrix.version }}
244
+ - uses : actions/download-artifact@v3
245
+ with :
246
+ name : openclash-${{ matrix.arch }}-${{ matrix.version }}
223
247
# - uses: actions/download-artifact@v3
224
248
# with:
225
249
# name: luci-app-netdata
226
- - name : Prepare Packages
250
+
251
+ - name : modify docker path
227
252
run : |
228
- export VOLUME_HOME=$(pwd)
229
- export BUILD_DIR="/builder"
230
- export BUILDER="buildbot"
231
- cd $BUILD_DIR
232
- mkdir -p $BUILD_DIR/packages/mypackages
233
- cp -r $VOLUME_HOME/* packages/mypackages/
234
- - name : Debug Print
253
+ sudo systemctl stop docker.socket
254
+ sudo systemctl stop docker
255
+ sudo mkdir -p ${{ github.workspace }}/docker
256
+ sudo mv /var/lib/docker ${{ github.workspace }}/docker
257
+ sudo ln -sf ${{ github.workspace }}/docker /var/lib/docker
258
+ sudo systemctl start docker
259
+
260
+
261
+ - name : Prepare Packages
235
262
run : |
236
- export VOLUME_HOME=$(pwd)
263
+ export VOLUME_HOME=${{ github.workspace }}
237
264
export BUILD_DIR="/builder"
238
265
export BUILDER="buildbot"
239
- apt update
240
- apt install tree sudo -y
241
- tree $BUILD_DIR/packages
266
+ mkdir -p $VOLUME_HOME/mypackages
267
+ mv $VOLUME_HOME/*.ipk $VOLUME_HOME/mypackages/
242
268
243
269
- name : Set profile
244
270
run : |
@@ -249,24 +275,25 @@ jobs:
249
275
fi
250
276
- name : Make Image
251
277
run : |
252
- export VOLUME_HOME=$(pwd)
278
+ export VOLUME_HOME=${{ github.workspace }}
253
279
export BUILD_DIR="/builder"
254
280
export BUILDER="buildbot"
255
- cd $BUILD_DIR
256
- chown -R $BUILDER:$BUILDER packages
257
- sudo -u $BUILDER sed -i "s/CONFIG_TARGET_ROOTFS_PARTSIZE=[0-9]\+/CONFIG_TARGET_ROOTFS_PARTSIZE=${{ env.rootfs_size }}/g;s/CONFIG_TARGET_KERNEL_PARTSIZE=[0-9]\+/CONFIG_TARGET_KERNEL_PARTSIZE=${{ env.kernel_size }}/g" .config
258
- echo ${{ env.profile }}
259
- sudo -u $BUILDER make image PROFILE=${{ env.profile }} PACKAGES="${{ env.packages }} packages/mypackages/*"
260
- mkdir -p $VOLUME_HOME/openwrt-${{ matrix.arch }}-${{ matrix.version }}
261
- tree bin/targets
262
- if ${{ matrix.arch == 'x86-64' }}; then
263
- cp bin/targets/x86/64/* $VOLUME_HOME/openwrt-${{ matrix.arch }}-${{ matrix.version }}/
264
- elif ${{ matrix.arch == 'rockchip-armv8' }}; then
265
- cp bin/targets/rockchip/armv8/* $VOLUME_HOME/openwrt-${{ matrix.arch }}-${{ matrix.version }}/
266
- fi
267
-
281
+ chmod +x $VOLUME_HOME/build_image.sh
282
+ docker run -i --name openwrt-imagebuilder-${{ matrix.arch }}-${{ matrix.version }} \
283
+ --user root \
284
+ -v $VOLUME_HOME/mypackages/:$BUILD_DIR/packages/mypackages/ \
285
+ -v $VOLUME_HOME/openwrt_output/:/openwrt_output/ \
286
+ -v $VOLUME_HOME/build_image.sh:/build_image.sh \
287
+ -e PROFILE=${{ env.profile }} \
288
+ -e PACKAGES="${{ env.packages }}" \
289
+ -e ROOTFS_SIZE=${{ env.rootfs_size }} \
290
+ -e KERNEL_SIZE=${{ env.kernel_size }} \
291
+ -e ARCH=${{ matrix.arch }} \
292
+ -e VERSION=${{ matrix.version }} \
293
+ openwrt/imagebuilder:${{ matrix.arch }}-${{ matrix.version }} /build_image.sh
294
+
268
295
env :
269
- rootfs_size : 2048
296
+ rootfs_size : 4096
270
297
kernel_size : 256
271
298
packages : luci luci-app-qos luci-app-upnp luci-proto-ipv6 kmod-igc kmod-mt7921e
272
299
luci-i18n-base-zh-cn netdata luci-app-ttyd ntpclient luci-app-ntpc pciutils
@@ -285,4 +312,4 @@ jobs:
285
312
- uses : actions/upload-artifact@v3
286
313
with :
287
314
name : openwrt-${{ matrix.arch }}-${{ matrix.version }}
288
- path : openwrt-${{ matrix.arch }}-${{ matrix.version }}
315
+ path : openwrt_output
0 commit comments