Skip to content

Commit

Permalink
整理优化项目文件
Browse files Browse the repository at this point in the history
  • Loading branch information
haiibo committed Aug 21, 2022
1 parent b28c8da commit 2503452
Show file tree
Hide file tree
Showing 26 changed files with 208 additions and 1,114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ARMv8-Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

env:
VERSION: MINI
EXPLAIN: 这是 ARMv8 精简版,集成一些日常常用插件
EXPLAIN: 这是 ARMv8 精简版,只集成了一些常用插件

steps:
- name: Checkout
Expand Down
54 changes: 14 additions & 40 deletions .github/workflows/ARMv8_Mini-OpenWrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 23 * * *'
- cron: '0 0 * * *'

env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
FEEDS_CONF: armv8/mini/feeds.conf.default
CONFIG_FILE: armv8/mini/.config
DIY_P1_SH: armv8/mini/diy-part1.sh
DIY_P2_SH: armv8/mini/diy-part2.sh
CONFIG_FILE: configs/armv8_mini.config
DIY_SCRIPT: diy-mini.sh
UPLOAD_BIN_DIR: false
UPLOAD_FIRMWARE: false
UPLOAD_RELEASE: true
TZ: Asia/Shanghai
FILE_NAME: ROOTFS_MINI
PRODUCT_NAME: ARMv8_MINI
TZ: Asia/Shanghai

jobs:
build:
Expand All @@ -36,29 +34,11 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Check server configuration
run: |
echo "警告⚠"
echo "若分配的服务器性能不足,务必及时取消,重新运行!"
echo "已知编译成功CPU型号:8370C,8171M"
echo "已知性能不足CPU型号:8272CL"
echo -e "-------------- ------------CPU信息------------------------------------------\n"
echo "CPU物理数量:$(cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l)"
echo -e "CPU核心及版本信息:$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n"
echo "-------------------------------内存信息-------------------------------------------"
echo "已安装内存详细信息:"
sudo lshw -short -C memory | grep GiB
echo -e "\n"
echo "-----------------------------硬盘信息---------------------------------------------"
echo -e "硬盘数量:$(ls /dev/sd* | grep -v [1-9] | wc -l) \n"
echo "硬盘详情:"
df -Th
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
docker rmi $(docker images -q)
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /etc/mysql /etc/php /usr/local/lib/android /opt/ghc
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* adoptopenjdk* mysql* php* mongodb* dotnet* moby* snapd* || true
sudo -E apt-get -qq update
Expand All @@ -80,13 +60,6 @@ jobs:
useVersionInfo=$(git show -s --date=short --format="Author: %an<br/>date: %cd<br/>commit: %s<br/>commit hash: %H")
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
- name: Load custom feeds
run: |
[ -e $FEEDS_CONF ] && mv $FEEDS_CONF openwrt/feeds.conf.default
chmod +x $DIY_P1_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P1_SH
- name: Update feeds
run: cd openwrt && ./scripts/feeds update -a

Expand All @@ -97,9 +70,9 @@ jobs:
run: |
[ -e files ] && mv files openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x $DIY_P2_SH
chmod +x $DIY_SCRIPT
cd openwrt
$GITHUB_WORKSPACE/$DIY_P2_SH
$GITHUB_WORKSPACE/$DIY_SCRIPT
- name: Download package
id: package
Expand All @@ -118,19 +91,19 @@ jobs:
make -j$(nproc) || make -j1 || make -j1 V=s
echo "::set-output name=status::success"
grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=$(cat DEVICE_NAME)" >> $GITHUB_ENV
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=_$(cat DEVICE_NAME)" >> $GITHUB_ENV
echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Check space usage
if: (!cancelled())
run: df -hT
run: df -Th

- name: Upload bin directory
uses: actions/upload-artifact@main
if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true'
with:
name: OpenWrt_bin_${{ env.DEVICE_NAME }}_${{ env.FILE_DATE }}
name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: openwrt/bin

- name: Organize files
Expand All @@ -140,6 +113,7 @@ jobs:
cp openwrt/.config build.config
mkdir -p Packages
mv -f openwrt/bin/packages/*/*/*.ipk Packages
mv -f openwrt/bin/targets/*/*/packages/*.ipk Packages
tar -zcvf Packages.tar.gz Packages
mv *.config *.tar.gz openwrt/bin/targets/*/*
cp -rf openwrt/bin/targets lean
Expand All @@ -152,7 +126,7 @@ jobs:
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
name: OpenWrt_firmware_${{ env.DEVICE_NAME }}_${{ env.FILE_DATE }}
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}

- name: Upload firmware to release
Expand Down Expand Up @@ -194,7 +168,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
**This is OpenWrt firmware for Armvirt 64**
* 这是 ARMv8 精简版,集成一些日常常用插件
* 这是 ARMv8 精简版,只集成了一些常用插件
默认 IP:192.168.1.1 默认密码:password
安装到 EMMC:系统 → 晶晨宝盒 → 安装 OpenWrt → 选择型号 → 安装
升级 OpenWrt:系统 → 晶晨宝盒 → 手动上传更新 或者 在线下载更新
Expand Down
52 changes: 13 additions & 39 deletions .github/workflows/ARMv8_Plus-OpenWrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 23 * * *'
- cron: '0 21 * * *'

env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
FEEDS_CONF: armv8/plus/feeds.conf.default
CONFIG_FILE: armv8/plus/.config
DIY_P1_SH: armv8/plus/diy-part1.sh
DIY_P2_SH: armv8/plus/diy-part2.sh
CONFIG_FILE: configs/armv8_plus.config
DIY_SCRIPT: diy-script.sh
UPLOAD_BIN_DIR: false
UPLOAD_FIRMWARE: false
UPLOAD_RELEASE: true
TZ: Asia/Shanghai
FILE_NAME: ROOTFS_PLUS
PRODUCT_NAME: ARMv8_PLUS
TZ: Asia/Shanghai

jobs:
build:
Expand All @@ -36,29 +34,11 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Check server configuration
run: |
echo "警告⚠"
echo "若分配的服务器性能不足,务必及时取消,重新运行!"
echo "已知编译成功CPU型号:8370C,8171M"
echo "已知性能不足CPU型号:8272CL"
echo -e "-------------- ------------CPU信息------------------------------------------\n"
echo "CPU物理数量:$(cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l)"
echo -e "CPU核心及版本信息:$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n"
echo "-------------------------------内存信息-------------------------------------------"
echo "已安装内存详细信息:"
sudo lshw -short -C memory | grep GiB
echo -e "\n"
echo "-----------------------------硬盘信息---------------------------------------------"
echo -e "硬盘数量:$(ls /dev/sd* | grep -v [1-9] | wc -l) \n"
echo "硬盘详情:"
df -Th
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
docker rmi $(docker images -q)
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /etc/mysql /etc/php /usr/local/lib/android /opt/ghc
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* adoptopenjdk* mysql* php* mongodb* dotnet* moby* snapd* || true
sudo -E apt-get -qq update
Expand All @@ -80,13 +60,6 @@ jobs:
useVersionInfo=$(git show -s --date=short --format="Author: %an<br/>date: %cd<br/>commit: %s<br/>commit hash: %H")
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
- name: Load custom feeds
run: |
[ -e $FEEDS_CONF ] && mv $FEEDS_CONF openwrt/feeds.conf.default
chmod +x $DIY_P1_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P1_SH
- name: Update feeds
run: cd openwrt && ./scripts/feeds update -a

Expand All @@ -97,9 +70,9 @@ jobs:
run: |
[ -e files ] && mv files openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x $DIY_P2_SH
chmod +x $DIY_SCRIPT
cd openwrt
$GITHUB_WORKSPACE/$DIY_P2_SH
$GITHUB_WORKSPACE/$DIY_SCRIPT
- name: Download package
id: package
Expand All @@ -118,19 +91,19 @@ jobs:
make -j$(nproc) || make -j1 || make -j1 V=s
echo "::set-output name=status::success"
grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=$(cat DEVICE_NAME)" >> $GITHUB_ENV
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=_$(cat DEVICE_NAME)" >> $GITHUB_ENV
echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Check space usage
if: (!cancelled())
run: df -hT
run: df -Th

- name: Upload bin directory
uses: actions/upload-artifact@main
if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true'
with:
name: OpenWrt_bin_${{ env.DEVICE_NAME }}_${{ env.FILE_DATE }}
name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: openwrt/bin

- name: Organize files
Expand All @@ -140,6 +113,7 @@ jobs:
cp openwrt/.config build.config
mkdir -p Packages
mv -f openwrt/bin/packages/*/*/*.ipk Packages
mv -f openwrt/bin/targets/*/*/packages/*.ipk Packages
tar -zcvf Packages.tar.gz Packages
mv *.config *.tar.gz openwrt/bin/targets/*/*
cp -rf openwrt/bin/targets lean
Expand All @@ -152,7 +126,7 @@ jobs:
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
name: OpenWrt_firmware_${{ env.DEVICE_NAME }}_${{ env.FILE_DATE }}
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}

- name: Upload firmware to release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Delete-Older-Artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Delete Older Artifacts
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
- cron: '0 2 * * *'

jobs:
Cleaning:
Expand Down
Loading

0 comments on commit 2503452

Please sign in to comment.