forked from SuLingGG/OpenWrt-Rpi
-
Notifications
You must be signed in to change notification settings - Fork 0
443 lines (399 loc) · 19 KB
/
build-rpi4-lean-openwrt-new.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
#=================================================
# https://github.com/P3TERX/Actions-OpenWrt
# Description: Build OpenWrt using GitHub Actions
# Lisence: MIT
# Author: P3TERX
# Blog: https://p3terx.com
#=================================================
name: Test Raspberry Pi 4 OpenWrt
on:
workflow_dispatch:
# schedule:
# - cron: 0 18 * * *
# watch:
# types: started
env:
CONFIG_FILE: config/bcm27xx/bcm2711.config
SOURCE_URL: https://github.com/immortalwrt/immortalwrt
SOURCE_BRANCH: openwrt-18.06-k5.4
DIY_SH: scripts/immortalwrt.sh
WEBROOT: /data/dnmp/www/openwrt.cc
TOOLCHAIN_TAG: toolchain
TOOLCHAIN_RELEASE_UPLOAD: true
FIRMWARE_RELEASE_UPLOAD: true
TZ: Asia/Shanghai
jobs:
Toolchain:
runs-on: ubuntu-20.04
outputs:
OPENWRTROOT: ${{ steps.clone.outputs.OPENWRTROOT }}
CURRENT_BRANCH: ${{ steps.env.outputs.CURRENT_BRANCH }}
SOURCE_OWNER: ${{ steps.env.outputs.SOURCE_OWNER }}
SOURCE_REPO: ${{ steps.env.outputs.SOURCE_REPO }}
PLATFORM: ${{ steps.env.outputs.PLATFORM }}
TARGET: ${{ steps.env.outputs.TARGET }}
SUBTARGET: ${{ steps.env.outputs.SUBTARGET }}
TOOLCHAIN_IMAGE: ${{ steps.env.outputs.TOOLCHAIN_IMAGE }}
steps:
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install squashfs-tools $(curl -fsSL git.io/depends-ubuntu-2004)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
docker image prune -a -f
- name: Checkout
uses: actions/checkout@main
- name: Clone Source Code
id: clone
run: |
df -hT $PWD
git clone $SOURCE_URL -b $SOURCE_BRANCH openwrt
cd openwrt
echo "OPENWRTROOT=$PWD" >> $GITHUB_ENV
echo "::set-output name=OPENWRTROOT::$(echo $PWD)"
- name: Generate Toolchain Config
run: |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE $OPENWRTROOT/.config
echo -e "\nCONFIG_ALL=y" >> $OPENWRTROOT/.config
echo -e "\nCONFIG_ALL_NONSHARED=y" >> $OPENWRTROOT/.config
cd $OPENWRTROOT
make defconfig > /dev/null 2>&1
- name: Generate Variables
id: env
run: |
export CURRENT_BRANCH="$(git symbolic-ref --short HEAD)"
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV
echo "::set-output name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH)"
cd $OPENWRTROOT
export SOURCE_OWNER="$(echo $SOURCE_URL | awk -F '/' '{print $(NF-1)}')"
echo "SOURCE_OWNER=$SOURCE_OWNER" >> $GITHUB_ENV
echo "::set-output name=SOURCE_OWNER::$(echo $SOURCE_OWNER)"
export SOURCE_REPO="$(echo $SOURCE_URL | awk -F '/' '{print $(NF)}')"
echo "SOURCE_REPO=$SOURCE_REPO" >> $GITHUB_ENV
echo "::set-output name=SOURCE_REPO::$(echo $SOURCE_REPO)"
export TARGET=$(cat .config | grep CONFIG_TARGET_BOARD | awk -F '"' '{print $2}')
echo "TARGET=$TARGET" >> $GITHUB_ENV
echo "::set-output name=TARGET::$(echo $TARGET)"
export SUBTARGET=$(cat .config | grep CONFIG_TARGET_SUBTARGET | awk -F '"' '{print $2}')
echo "SUBTARGET=$SUBTARGET" >> $GITHUB_ENV
echo "::set-output name=SUBTARGET::$(echo $SUBTARGET)"
export PLATFORM=$(cat .config | grep CONFIG_TARGET_ARCH_PACKAGES | awk -F '"' '{print $2}')
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
echo "::set-output name=PLATFORM::$(echo $PLATFORM)"
export TOOLCHAIN_IMAGE="toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$TARGET-$SUBTARGET"
echo "TOOLCHAIN_IMAGE=$TOOLCHAIN_IMAGE" >> $GITHUB_ENV
echo "::set-output name=TOOLCHAIN_IMAGE::$(echo $TOOLCHAIN_IMAGE)"
- name: Compare Toolchain Hash
id: hash
run: |
cd $OPENWRTROOT
export CURRENT_HASH=$(git log --pretty=tformat:"%H" -n1 tools toolchain)
echo "CURRENT_HASH=$CURRENT_HASH" >> $GITHUB_ENV
echo "::set-output name=CURRENT_HASH::$(echo $CURRENT_HASH)"
echo "CURRENT_HASH is $CURRENT_HASH"
export CACHE_HASH=$(curl -fSsL https://github.com/$GITHUB_REPOSITORY/releases/download/$TOOLCHAIN_TAG/$TOOLCHAIN_IMAGE.hash)
echo "CACHE_HASH is $CACHE_HASH"
if [ -z "$CACHE_HASH" ] || [ "$CURRENT_HASH" != "$CACHE_HASH" ]; then
echo "::set-output name=REBUILD_TOOLCHAIN::true"
fi
- name: Install Feeds
if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
run: |
cd $OPENWRTROOT
./scripts/feeds update -a
./scripts/feeds install -a
- name: Compile Tools
if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
run: |
cd $OPENWRTROOT
echo -e "$(nproc) thread compile"
make tools/compile -j$(nproc) || make tools/compile -j1 V=s
- name: Compile Toolchain
if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
run: |
cd $OPENWRTROOT
echo -e "$(nproc) thread compile"
make toolchain/compile -j$(nproc) || make toolchain/compile -j1 V=s
rm -rf .config* dl bin
- name: Generate Toolchain Image
if: steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
run: |
mksquashfs openwrt $TOOLCHAIN_IMAGE -force-gid 1001 -force-uid 1001 -comp zstd
mkdir output
split -d -b 1900M $TOOLCHAIN_IMAGE output/$TOOLCHAIN_IMAGE.img.
rm $TOOLCHAIN_IMAGE
cd $OPENWRTROOT
echo $CURRENT_HASH > ../output/toolchain-$SOURCE_OWNER-$SOURCE_REPO-$SOURCE_BRANCH-$TARGET-$SUBTARGET.hash
ls -lh ../output
# - name: Upload Toolchain Image To Artifact
# if: env.TOOLCHAIN_RELEASE_UPLOAD != 'true' && steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
# uses: actions/upload-artifact@main
# with:
# name: ${{ env.TOOLCHAIN_IMAGE }}
# path: output
- name: Upload Toolchain Image To Release
if: env.TOOLCHAIN_RELEASE_UPLOAD == 'true' && steps.hash.outputs.REBUILD_TOOLCHAIN == 'true'
uses: ncipollo/[email protected]
with:
name: toolchain-image
allowUpdates: true
replacesArtifacts: true
tag: ${{ env.TOOLCHAIN_TAG }}
commit: ${{ env.CURRENT_BRANCH }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: output/*
Build:
needs: [Toolchain]
runs-on: ubuntu-20.04
steps:
- name: Restore Variables
run: |
echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV
echo "OPENWRTROOT=$(echo '${{needs.Toolchain.outputs.OPENWRTROOT}}')" >> $GITHUB_ENV
echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV
echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV
echo "PLATFORM=$(echo '${{needs.Toolchain.outputs.PLATFORM}}')" >> $GITHUB_ENV
echo "TARGET=$(echo '${{needs.Toolchain.outputs.TARGET}}')" >> $GITHUB_ENV
echo "SUBTARGET=$(echo '${{needs.Toolchain.outputs.SUBTARGET}}')" >> $GITHUB_ENV
echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install rdate squashfs-tools $(curl -fsSL git.io/depends-ubuntu-2004)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
docker image prune -a -f
- name: Combine Disks
run: |
sudo swapoff -a
sudo rm -f /mnt/swapfile
export ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1)
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
sudo mkfs.btrfs -f -d raid0 -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
sudo chown -R runner:runner $GITHUB_WORKSPACE
mkdir $GITHUB_WORKSPACE/tmp
chmod 777 $GITHUB_WORKSPACE/tmp
sudo cp -rp /tmp/* $GITHUB_WORKSPACE/tmp
sudo mount -B $GITHUB_WORKSPACE/tmp /tmp
df -hT $GITHUB_WORKSPACE
sudo btrfs filesystem usage $GITHUB_WORKSPACE
- name: Checkout
run: |
cd $GITHUB_WORKSPACE
git init
git remote add origin https://github.com/$GITHUB_REPOSITORY
git fetch
git checkout -t origin/$CURRENT_BRANCH
# - name: Download Toolchain Image
# if: env.TOOLCHAIN_RELEASE_UPLOAD != 'true'
# uses: actions/download-artifact@v2
# with:
# name: ${{ env.TOOLCHAIN_IMAGE }}
# path: toolchain
# - name: Prepare Toolchain Image
# if: env.TOOLCHAIN_RELEASE_UPLOAD != 'true'
# run: |
# cd toolchain
# for i in {1..9}
# do
# cat $TOOLCHAIN_IMAGE.img.0$i >> $TOOLCHAIN_IMAGE.img.00 && rm $TOOLCHAIN_IMAGE.img.0$i || break
# done
# mv $TOOLCHAIN_IMAGE.img.00 ../$TOOLCHAIN_IMAGE.img
# cd ..
# mkdir openwrt-ro openwrt workdir overlay
# sudo mount -o loop $TOOLCHAIN_IMAGE.img openwrt-ro
# sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt
# cd $OPENWRTROOT
# git pull
- name: Prepare Toolchain Image
if: env.TOOLCHAIN_RELEASE_UPLOAD == 'true'
run: |
for i in {0..9}
do
curl -fsL https://github.com/$GITHUB_REPOSITORY/releases/download/$TOOLCHAIN_TAG/$TOOLCHAIN_IMAGE.img.0$i >> $TOOLCHAIN_IMAGE.img || break
done
mkdir openwrt-ro openwrt workdir overlay
sudo mount -o loop $TOOLCHAIN_IMAGE.img openwrt-ro
sudo mount -t overlay overlay -o lowerdir=openwrt-ro,upperdir=overlay,workdir=workdir openwrt
cd $OPENWRTROOT
git pull
- name: Load Custom Configuration
run: |
[ -e files ] && mv files $OPENWRTROOT/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE $OPENWRTROOT/.config
cat config/general-packages-new.config >> $OPENWRTROOT/.config
chmod +x scripts/*.sh
cd $OPENWRTROOT
echo -e "CONFIG_USB_LAN78XX=y\nCONFIG_USB_NET_DRIVERS=y" >> target/linux/bcm27xx/bcm2711/config-5.4
../$DIY_SH
../scripts/preset-clash-core.sh armv8
../scripts/preset-terminal-tools.sh
../scripts/enable-rpi4-wifi.sh
make defconfig
- name: Install Feeds
run: |
cd $OPENWRTROOT
./scripts/feeds update -a
./scripts/feeds install -a
- name: Download DL Package
id: download
run: |
cd $OPENWRTROOT
make download -j64
- name: Compile Packages
run: |
cd $OPENWRTROOT
echo -e "$(nproc) thread compile"
make buildinfo
make diffconfig buildversion feedsversion
make target/compile -j$(nproc) || make target/compile -j1 V=s IGNORE_ERRORS=1
make package/compile -j$(nproc) IGNORE_ERRORS=1 || make package/compile -j1 V=s IGNORE_ERRORS=1
make package/index
- name: Generate Firmware
id: generate
run: |
cd data/opkg
sed -i "s/subtarget/$SUBTARGET/g" distfeeds.conf
sed -i "s/target\//$TARGET\//g" distfeeds.conf
sed -i "s/platform/$PLATFORM/g" distfeeds.conf
cd $OPENWRTROOT
echo "dtparam=i2c_arm=on,audio=on" >> target/linux/bcm27xx/image/config.txt
mkdir -p files/etc/uci-defaults/
cp ../scripts/init-settings.sh files/etc/uci-defaults/99-init-settings
mkdir -p files/www/snapshots
cp -r bin/targets files/www/snapshots
mkdir -p files/etc/opkg
cp ../data/opkg/distfeeds.conf files/etc/opkg
mkdir -p files/www/ipv6-modules
cp bin/packages/$PLATFORM/luci/luci-proto-ipv6* files/www/ipv6-modules
cp bin/packages/$PLATFORM/base/{ipv6helper*,odhcpd-ipv6only*,odhcp6c*,6in4*} "files/www/ipv6-modules"
cp bin/targets/$TARGET/$SUBTARGET/packages/{ip6tables*,kmod-nf-nat6*,kmod-ipt-nat6*,kmod-sit*,kmod-ip6tables-extra*} "files/www/ipv6-modules"
mkdir -p files/bin
cp ../scripts/ipv6-helper.sh files/bin/ipv6-helper
make package/install -j$(nproc) || make package/install -j1 V=s
make target/install -j$(nproc) || make target/install -j1 V=s
make json_overview_image_info
make checksum
- name: Compress Bin Folder
run: |
cd $OPENWRTROOT
zip -r $TARGET-$SUBTARGET.zip bin
- name: Print Disk Usage
run: |
sudo btrfs filesystem usage $GITHUB_WORKSPACE
- name: Upload Bin Archive
uses: actions/upload-artifact@main
with:
name: bin-archive
path: ${{ env.OPENWRTROOT }}/${{ env.TARGET }}-${{ env.SUBTARGET }}.zip
Upload:
needs: [Build, Toolchain]
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: Restore Variables
run: |
echo "CURRENT_BRANCH=$(echo '${{needs.Toolchain.outputs.CURRENT_BRANCH}}')" >> $GITHUB_ENV
echo "OPENWRTROOT=$(echo '${{needs.Toolchain.outputs.OPENWRTROOT}}')" >> $GITHUB_ENV
echo "SOURCE_OWNER=$(echo '${{needs.Toolchain.outputs.SOURCE_OWNER}}')" >> $GITHUB_ENV
echo "SOURCE_REPO=$(echo '${{needs.Toolchain.outputs.SOURCE_REPO}}')" >> $GITHUB_ENV
echo "PLATFORM=$(echo '${{needs.Toolchain.outputs.PLATFORM}}')" >> $GITHUB_ENV
echo "TARGET=$(echo '${{needs.Toolchain.outputs.TARGET}}')" >> $GITHUB_ENV
echo "SUBTARGET=$(echo '${{needs.Toolchain.outputs.SUBTARGET}}')" >> $GITHUB_ENV
echo "TOOLCHAIN_IMAGE=$(echo '${{needs.Toolchain.outputs.TOOLCHAIN_IMAGE}}')" >> $GITHUB_ENV
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install zip unzip rsync
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- name: Download Bin Archive
uses: actions/download-artifact@v2
with:
name: bin-archive
path: ${{ env.OPENWRTROOT }}
- name: Decompress Bin Archive
run: |
cd $OPENWRTROOT
unzip $TARGET-$SUBTARGET.zip
# - name: Deploy Files To HostHatch Node
# env:
# HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.HOSTHATCH_IP }}"
# SOURCE_TARGETS: "openwrt/bin/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/"
# DEST_TARGETS: "${{ env.WEBROOT }}/releases/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/"
# REMOTE_PRIVATEKEY: "${{secrets.HOSTHATCH_PRIVATEKEY}}"
# if: env.REMOTE_PRIVATEKEY != null
# run: |
# mkdir -p ~/.ssh/
# install -m 600 /dev/null ~/.ssh/id_rsa
# echo "${{secrets.HOSTHATCH_PRIVATEKEY}}" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \
# bash -c "'mkdir -p $WEBROOT/releases/targets/$TARGET/$SUBTARGET'"
# rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS
# - name: Deploy Files To PacificRack Node
# env:
# HOST: "${{ secrets.REMOTE_USER }}@${{ secrets.PACIFICRACK_IP }}"
# SOURCE_TARGETS: "openwrt/bin/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/"
# DEST_TARGETS: "${{ env.WEBROOT }}/releases/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/"
# REMOTE_PRIVATEKEY: "${{secrets.PACIFICRACK_PRIVATEKEY}}"
# if: env.REMOTE_PRIVATEKEY != null
# run: |
# mkdir -p ~/.ssh/
# install -m 600 /dev/null ~/.ssh/id_rsa
# echo "${{secrets.PACIFICRACK_PRIVATEKEY}}" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST \
# bash -c "'mkdir -p $WEBROOT/releases/targets/$TARGET/$SUBTARGET'"
# rsync -chavP --delete -e 'ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no' $SOURCE_TARGETS $HOST:$DEST_TARGETS
# echo "::warning file=openwrt.cc::Download Link: https://openwrt.cc/releases/targets/bcm27xx/bcm2711"
- name: Organize Files
run: |
cd $OPENWRTROOT/bin/targets/$TARGET/$SUBTARGET
rm -rf packages
df -hT $PWD
- name: Deploy Files To Release
uses: ncipollo/[email protected]
if: env.FIRMWARE_RELEASE_UPLOAD == 'true'
with:
name: openwrt-${{ env.TARGET }}-${{ env.SUBTARGET }}
allowUpdates: true
replacesArtifacts: true
tag: ${{ env.TARGET }}-${{ env.SUBTARGET }}
commit: ${{ env.CURRENT_BRANCH }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{ env.OPENWRTROOT }}/bin/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/*
# - name: Deploy Files To Onedrive
# env:
# SOURCE_TARGETS: "openwrt/bin/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/"
# DEST_TARGETS: "releases/targets/${{ env.TARGET }}"
# ONEDRIVEUPLOADER_CONF: "${{ secrets.ONEDRIVEUPLOADER_CONF }}"
# if: env.ONEDRIVEUPLOADER_CONF != null
# run: |
# echo -e "${ONEDRIVEUPLOADER_CONF}" | tee ./auth.json > /dev/null
# wget -q https://raw.githubusercontent.com/MoeClub/OneList/master/OneDriveUploader/amd64/linux/OneDriveUploader
# chmod +x OneDriveUploader
# ./OneDriveUploader -f -c "./auth.json" -s $SOURCE_TARGETS -r $DEST_TARGETS
# ./OneDriveUploader -f -c "./auth.json" -s $SOURCE_TARGETS -r "archive/$(date +%Y)/$(date +%m)/$(date +%d)/releases/targets/$TARGET/$SUBTARGET"
# ./OneDriveUploader -f -c "./auth.json" -s $OPENWRTROOT/$TARGET-$SUBTARGET.zip -r "archive/$(date +%Y)/$(date +%m)/$(date +%d)/releases/bin-archive"
# echo "::warning file=mirror.openwrt.cc::Download Link: https://mirror.openwrt.cc/releases/targets/bcm27xx/bcm2711"