Skip to content

Commit db37480

Browse files
committed
build: build and deploy packages
1 parent 4a4036d commit db37480

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/lo-test.yml

+31-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
env:
1818
DEVICE: ${{ github.event.client_payload.device || github.event.inputs.device }}
1919
TG: ${{ secrets.TELEGRAM_BOT_TOKEN }}
20+
DEPLOY_SSHKEY: ${{ secrets.SSH_KEY }}
2021
if: github.event.repository.owner.id == github.event.sender.id
2122

2223
steps:
@@ -106,6 +107,7 @@ jobs:
106107
mkdir -p ./artifact/buildinfo
107108
mkdir -p ./release
108109
cd lede
110+
cp -a bin tmp ../
109111
rm -rf $(find ./bin/targets/ -type d -name "packages")
110112
cp -rf $(find ./bin/targets/ -type f) ../artifact/firmware/
111113
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ../artifact/package/
@@ -114,7 +116,7 @@ jobs:
114116
pushd ../release/ && md5sum $DEVICE.img.gz > md5sum.txt && popd
115117
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
116118
echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV
117-
rm -rf bin/ tmp/
119+
rm -rf bin tmp
118120
cd ..
119121
mv artifact release $GITHUB_WORKSPACE
120122
@@ -176,3 +178,31 @@ jobs:
176178
to: ${{ secrets.TELEGRAM_CHAT_ID }}
177179
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
178180
args: The ${{env.DEVICE}} build ran completed at ${{job.status}}.
181+
182+
- name: Build and deploy packages
183+
if: env.DEPLOY_SSHKEY
184+
run: |
185+
cd
186+
truncate -s +10G lede.img
187+
sudo losetup -P --direct-io $LOOP_DEVICE lede.img
188+
sudo mount -o nossd,compress=zstd $LOOP_DEVICE lede
189+
sudo btrfs filesystem resize max lede/
190+
mv bin tmp lede/
191+
cd lede
192+
find package/ -type d -name luci-app-* | rev | cut -d'/' -f1 | rev | sort | xargs -n1 -i echo CONFIG_PACKAGE_{}=m >> .config
193+
make defconfig
194+
make target/linux/compile -j$(($(nproc) + 1))
195+
find package/ -type d -name luci-app-* | xargs -n1 -i sh -c "make {}/compile -j$(($(nproc) + 1)) || true"
196+
make package/index
197+
mkdir -p ~/.ssh; echo ${{env.DEPLOY_SSHKEY}} | base64 -d > ~/.ssh/id_ed25519; chmod 600 ~/.ssh/id_ed25519
198+
rsync -avz --progress -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
199+
bin/packages/*/base [email protected]:/usr/share/caddy/$DEVICE/
200+
rsync -avz --progress -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
201+
bin/targets/*/*/packages/ [email protected]:/usr/share/caddy/$DEVICE/core/
202+
203+
- name: Debug via tmate
204+
uses: P3TERX/ssh2actions@main
205+
if: ${{ failure() && env.TG }}
206+
env:
207+
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
208+
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}

assets/banner

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
██████╗ ██████╗ ███████╗███╗ ██╗██╗ ██╗██████╗ ████████╗
2+
██╔═══██╗██╔══██╗██╔════╝████╗ ██║██║ ██║██╔══██╗╚══██╔══╝
3+
██║ ██║██████╔╝█████╗ ██╔██╗ ██║██║ █╗ ██║██████╔╝ ██║
4+
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║██║███╗██║██╔══██╗ ██║
5+
╚██████╔╝██║ ███████╗██║ ╚████║╚███╔███╔╝██║ ██║ ██║
6+
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝
7+

0 commit comments

Comments
 (0)