autoupdate: fix md5 checksum

This commit is contained in:
John Doe
2021-03-21 12:40:36 +08:00
parent d42e01deb3
commit 1c3cb114b3
2 changed files with 11 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ jobs:
echo >> .config echo >> .config
find package/ -type d -name luci-app-* | rev | cut -d'/' -f1 | rev | xargs -n1 -i echo "# CONFIG_PACKAGE_{} is not set" >> .config find package/ -type d -name luci-app-* | rev | cut -d'/' -f1 | rev | xargs -n1 -i echo "# CONFIG_PACKAGE_{} is not set" >> .config
- name: Compile firmware - name: Build and deploy packages
run: | run: |
cd ~/lede cd ~/lede
@@ -139,6 +139,7 @@ jobs:
rm -rf bin tmp rm -rf bin tmp
cd .. cd ..
mv artifact release $GITHUB_WORKSPACE mv artifact release $GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/release/ && md5sum $DEVICE-slim.img.gz > $DEVICE-slim.img.md5
- name: Deliver buildinfo - name: Deliver buildinfo
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@@ -151,10 +152,10 @@ jobs:
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./release/* file: ./release/*
tag: ${{env.DEVICE}}-${{env.strDate}} tag: ${{env.strDate}}
file_glob: true file_glob: true
overwrite: true overwrite: true
release_name: ${{env.strDevice}} ${{env.strDate}} 自动发布 release_name: ${{env.strDate}} 自动发布
- name: Save cache state - name: Save cache state
if: env.TG if: env.TG
@@ -230,6 +231,7 @@ jobs:
make defconfig && make -j$(($(nproc) + 1)) make defconfig && make -j$(($(nproc) + 1))
mkdir -p $GITHUB_WORKSPACE/release mkdir -p $GITHUB_WORKSPACE/release
mv $(ls -1 ./bin/targets/*/*/*img.gz) $GITHUB_WORKSPACE/release/$DEVICE.img.gz mv $(ls -1 ./bin/targets/*/*/*img.gz) $GITHUB_WORKSPACE/release/$DEVICE.img.gz
cd $GITHUB_WORKSPACE/release/ && md5sum $DEVICE.img.gz > $DEVICE.img.md5
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV
@@ -238,10 +240,10 @@ jobs:
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./release/* file: ./release/*
tag: ${{env.DEVICE}}-${{env.strDate}} tag: ${{env.strDate}}
file_glob: true file_glob: true
overwrite: true overwrite: true
release_name: ${{env.strDevice}} ${{env.strDate}} 自动发布 release_name: ${{env.strDate}} 自动发布
- name: Debug via tmate - name: Debug via tmate
uses: klever1988/ssh2actions@main uses: klever1988/ssh2actions@main

View File

@@ -18,15 +18,15 @@ chmod +x /tmp/truncate /tmp/ddnz
board_id=$(cat /etc/board.json | jsonfilter -e '@["model"].name' | tail -c 4 | tr -d "\n" | awk '{print tolower($0)}') board_id=$(cat /etc/board.json | jsonfilter -e '@["model"].name' | tail -c 4 | tr -d "\n" | awk '{print tolower($0)}')
mount -t tmpfs -o remount,size=650m tmpfs /tmp mount -t tmpfs -o remount,size=650m tmpfs /tmp
rm -rf /tmp/upg && mkdir /tmp/upg && cd /tmp/upg rm -rf /tmp/upg && mkdir /tmp/upg && cd /tmp/upg
wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$board_id-$(date +%Y-%m-%d)/$board_id.img.gz || true wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.gz -O $board_id.img.gz || true
if [ -f $board_id.img.gz ]; then if [ -f $board_id.img.gz ]; then
wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$board_id-$(date +%Y-%m-%d)/md5sum.txt wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
echo -e '\e[92m今天固件已下载准备解压\e[0m' echo -e '\e[92m今天固件已下载准备解压\e[0m'
else else
echo -e '\e[91m今天的固件还没更新尝试下载昨天的固件\e[0m' echo -e '\e[91m今天的固件还没更新尝试下载昨天的固件\e[0m'
wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$board_id-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id.img.gz || true wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.gz -O $board_id.img.gz || true
if [ -f $board_id.img.gz ]; then if [ -f $board_id.img.gz ]; then
wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$board_id-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/md5sum.txt wget https://ghproxy.com/https://github.com/klever1988/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
echo -e '\e[92m昨天的固件已下载准备解压\e[0m' echo -e '\e[92m昨天的固件已下载准备解压\e[0m'
else else
echo -e '\e[91m没找到最新的固件脚本退出\e[0m' echo -e '\e[91m没找到最新的固件脚本退出\e[0m'