.github/workflows/x96max.yml #613
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
name: Build x96max img86+o and 86+ | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
inputs: | |
days: | |
description: 'Number of days.' | |
required: true | |
default: 60 | |
minimum_runs: | |
description: 'The minimum runs to keep for each workflow.' | |
required: true | |
default: 6 | |
schedule: | |
- cron: 0 23 * * * | |
env: | |
UPLOAD_COWTRANSFER: false | |
RELEASE: true | |
TZ: Asia/Shanghai | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
name: Build for ${{ matrix.flippy_name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- flippy_name: 86+o | |
release_name: x96max-jcnf-mini-86+o.img | |
- flippy_name: 86+ | |
release_name: x96max-jcnf-mini-86+.img | |
env: | |
FLIPPY_NAME: ${{ matrix.flippy_name }} | |
RELEASE_NAME: ${{ matrix.release_name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Initialization environment | |
run: | | |
version=$(curl -s "https://api.github.com/repos/Netflixxp/shangyou/releases/latest" | awk -F '"' '/tag_name/{print $4}') | |
echo "version=$version" >> $GITHUB_ENV | |
echo "DATE=$(date "+%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | |
sudo chmod -R 777 /opt | |
cp -r ${FLIPPY_NAME}/opt/* /opt | |
- name: Download | |
run: | | |
cd /opt/openwrt_packit | |
wget https://github.com/Netflixxp/shangyou/releases/download/$version/openwrt-armvirt-64-default-rootfs.tar.gz | |
- name: Check Files | |
run: | | |
cd /opt/openwrt_packit | |
ls | |
- name: Install the package | |
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 xz-utils btrfs-progs gawk zip unzip curl dosfstools uuid-runtime | |
sudo -E apt-get -qq install git git-core | |
sudo -E apt-get -qq install pigz | |
sudo -E apt-get -qq autoremove --purge | |
sudo -E apt-get -qq clean | |
- name: build img | |
run: | | |
sudo chmod -R 777 /opt | |
cd /opt/openwrt_packit | |
sudo chmod +x mk_s905x2_x96max.sh | |
sudo ./mk_s905x2_x96max.sh | |
- name: copy update files | |
run: | | |
cd /opt/openwrt_packit | |
sudo cp files/openwrt-update-amlogic output/openwrt-update-amlogic | |
- name: pigz -9 | |
id: pigz | |
run: | | |
sudo chmod -R 777 /opt/openwrt_packit/output | |
cd /opt/openwrt_packit/output | |
sudo pigz -9 $RELEASE_NAME | |
echo "::set-output name=status::success" | |
- name: Check Files4 | |
run: | | |
cd /opt/openwrt_packit/output | |
ls | |
- name: 编译后硬盘容量 | |
if: (!cancelled()) | |
run: df -hT | |
- name: Create release | |
id: release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ env.DATE }} 🚀 N1/ x96max-Openwrt-img | 编译 | |
allowUpdates: true | |
tag: ${{ env.version }} | |
commit: main | |
token: ${{ secrets.RELEASES_TOKEN }} | |
body: | | |
## 以下为N1、HK1、x96max的最新固件(每日上午7时自动编译打包最新固件) | |
默认IP:192.168.1.99 默认密码: password | |
Openwrt🚀(注:此版本为jcnf个人的精简版。+o版内核更稳定) | |
N1和x96max全新安装方法: | |
1. cd root | |
2. ./install-to-emmc.sh | |
N1和x96max在线升级方法: | |
1. cd /mnt/mmcblk2p4 | |
2. wget 升级脚本链接,鼠标右击openwrt-update-amlogic 文件获取链接地址 | |
3. wget img.gz后缀名的固件链接,鼠标右击后缀.img.gz文件获取链接地址 | |
4. gzip -d 解压缩上一步下载的固件全名 | |
5. chmod +x openwrt-update-amlogic | |
6. ./openwrt-update-amlogic后,选择y是保留配置升级,选n相当于重装。 | |
7.升级完成后系统会自动重启,稍安勿躁。 | |
artifacts: "/opt/openwrt_packit/output/*" | |
- name: Upload firmware to WeTransfer | |
if: steps.gz.outputs.status == 'success' && env.UPLOAD_COWTRANSFER == 'true' && !cancelled() | |
run: | | |
curl -fsSL git.io/file-transfer | sh | |
./transfer cow --block 2621440 -s -p 64 --no-progress /opt/openwrt/tmp/$RELEASE_NAME.gz 2>&1 | tee cowtransfer.log | |
echo "::warning file=cowtransfer.com::$(cat cowtransfer.log | grep https)" | |
echo "::set-output name=url::$(cat cowtransfer.log | grep https | cut -f3 -d" ")" | |
- name: Remove old Releases | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 3 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
over: | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: TG notification #TG推送 | |
run: curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}&text=x96max86+0和x96max86+打包成功" |