Releases ARMv8 OpenWrt #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#======================================================================================================================== | |
# https://github.com/ophub/amlogic-s9xxx-openwrt | |
# Description: Use Releases file to packaging | |
# Cron: min (0 - 59) / hour (0 - 23) / day of month (1 - 31) / month (1 - 12) / day of week (0 - 6)(Sunday - Saturday) | |
#======================================================================================================================== | |
name: Releases ARMv8 OpenWrt | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
inputs: | |
ssh: | |
description: 'SSH connection' | |
required: false | |
default: 'false' | |
schedule: | |
- cron: '05 10 * * 4' | |
env: | |
REPO_URL: https://github.com/coolsnowwolf/lede | |
REPO_BRANCH: master | |
FEEDS_CONF: feeds.conf.default | |
CONFIG_FILE: config/ARMv8.config | |
DIY_P1_SH: sh/lede_diy-part1.sh | |
DIY_P2_SH: sh/breakings_diy-part2.sh | |
DIY_P3_SH: sh/ARMv8_diy-part2.sh | |
UPLOAD_FIRMWARE: true | |
UPLOAD_RELEASE: true | |
RECENT_LASTEST: 30 | |
TZ: Asia/Shanghai | |
FILE_NAME: ARMv8 | |
PRODUCT_NAME: ARMv8 | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android 2>/dev/null | |
sudo -E apt -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true | |
[[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" | |
sudo -E apt update | |
sudo -E apt -y install $(curl -fsSL https://is.gd/depends_ubuntu_2204) | |
sudo -E apt -y autoremove --purge | |
sudo -E systemctl daemon-reload | |
sudo -E apt clean && sudo -E apt autoclean | |
sudo timedatectl set-timezone "$TZ" | |
sudo mkdir -p /mnt/workdir | |
sudo chown $USER:$GROUPS /mnt/workdir | |
- name: Clone source code | |
working-directory: /mnt/workdir | |
run: | | |
df -hT $PWD | |
git clone $REPO_URL -b $REPO_BRANCH openwrt | |
ln -sf /mnt/workdir/openwrt $GITHUB_WORKSPACE/openwrt | |
cd openwrt | |
useVersionInfo=$(git show -s --date=short --format="提交人: %an<br/>提交时间: %cd<br/>提交内容: %s<br/>commit hash: %H") | |
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV | |
echo "DATE=$(date "+%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | |
echo "DATE1=$(date "+%Y-%m-%d")" >> $GITHUB_ENV | |
echo "DATE2=$(date "+%Y%m%d%H%M")" >> $GITHUB_ENV | |
- name: Package Armvirt as OpenWrt | |
if: (!cancelled()) | |
uses: ophub/flippy-openwrt-actions@main | |
env: | |
OPENWRT_ARMVIRT: https://github.com/fichenx/Actions-OpenWrt/releases/download/openwrt_armvirt/openwrt-armvirt-64-generic-rootfs.tar.gz | |
PACKAGE_SOC: s905d_s905x3 | |
WHOAMI: fichenx | |
KERNEL_REPO_URL: https://github.com/breakings/OpenWrt/tree/main/opt | |
KERNEL_VERSION_NAME: 5.4.210_5.10.136_5.15.74_6.1.20_6.6.27 | |
OPENWRT_VER: R23.5.1 | |
KERNEL_AUTO_LATEST: true | |
GZIP_IMGS: .gz | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: SSH connection to Actions @ Ctrl+C to enter, Ctrl+D to exit | |
uses: P3TERX/ssh2actions@main | |
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh') | |
env: | |
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
- name: Upload artifact to Actions | |
uses: kittaakos/upload-artifact-as-is@master | |
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled() | |
with: | |
path: ${{ env.PACKAGED_OUTPUTPATH }}/ | |
- name: Upload OpenWrt Firmware to Release | |
id: release | |
uses: ncipollo/release-action@main | |
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() | |
with: | |
name: ${{ env.DATE }} OpenWrt for ${{ env.FILE_NAME }} | |
allowUpdates: true | |
removeArtifacts: true | |
tag: ${{ env.DATE2 }}_${{ env.FILE_NAME }} | |
commit: main | |
token: ${{ secrets.RELEASES_TOKEN }} | |
artifacts: ${{ env.PACKAGED_OUTPUTPATH }} | |
body: | | |
#### ARMv8 Openwrt 固件配置: | |
- IP:192.168.123.2 | |
- WEB登陆账户:root | |
- 密码:password | |
- 固件源码:https://github.com/coolsnowwolf/lede | |
- 固件内核:https://github.com/breakings/OpenWrt/releases/tag/kernel_stable | |
- 固件内置插件打包:[内置ipk打包下载](https://github.com/fichenx/Actions-OpenWrt/releases/download/openwrt_armvirt/Packages.tar.gz) | |
- 常见问题及注意事项请参考恩山F大➦[最新帖](https://www.right.com.cn/forum/thread-4076037-1-1.html) | |
#### 升级脚本用法: | |
- 升级固件脚本:新:[openwrt-update-amlogic](https://raw.githubusercontent.com/unifreq/openwrt_packit/master/files/openwrt-update-amlogic) | 旧:[update-amlogic-openwrt.sh](https://raw.githubusercontent.com/unifreq/openwrt_packit/master/files/scripts_deprecated/update-amlogic-openwrt.sh) | |
- openwrt-update-amlogic 以及镜像文件 xxxxxxx.img用winscp工具上传至/mnt/mmcblk2p4, | |
- cd /mnt/mmcblk2p4 | |
- chmod 755 openwrt-update-amlogic | |
- ./openwrt-update-amlogic xxxxxxx.img (或者用晶晨宝盒也可以更新) | |
#### 源码最近提交信息: | |
- ${{ env.useVersionInfo }} | |
- name: Delete older workflow runs and artifacts | |
uses: Mattraks/delete-workflow-runs@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
delete_workflow_pattern: Releases ARMv8 OpenWrt | |
retain_days: 30 | |
keep_minimum_runs: 10 | |
- name: Delete older releases | |
uses: codesnas/delete-older-releases@main | |
if: env.UPLOAD_RELEASE == 'true' && !cancelled() | |
with: | |
repo: | |
keep_latest: 10 | |
delete_tag_pattern: ARMv8 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |