-
Notifications
You must be signed in to change notification settings - Fork 72
143 lines (122 loc) · 4.52 KB
/
hk157.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
name: Build HK1 img57+o
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
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: 57
release_name: HK1-jcnf-mini-57+o.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/op-/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/kernel
wget https://github.com/Netflixxp/op-/releases/download/$version/openwrt-armvirt-64-default-rootfs.tar.gz
- name: Check Files
run: |
cd /opt/kernel
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/kernel
sudo chmod +x mk_s905x3_multi.sh
sudo ./mk_s905x3_multi.sh
- name: copy update files
run: |
cd /opt/kernel
sudo cp files/update-amlogic-openwrt.sh tmp/update-amlogic-openwrt.sh
- name: pigz -9
id: pigz
run: |
sudo chmod -R 777 /opt/kernel/tmp
cd /opt/kernel/tmp
sudo pigz -9 $RELEASE_NAME
echo "::set-output name=status::success"
- name: Check Files4
run: |
cd /opt/kernel/tmp
ls
- name: 编译后硬盘容量
if: (!cancelled())
run: df -hT
- name: Create release
id: release
uses: ncipollo/release-action@v1
with:
name: ${{ env.DATE }} 🚀 N1/ hk1-Openwrt-img | 编译
allowUpdates: true
tag: ${{ env.version }}
commit: main
token: ${{ secrets.RELEASES_TOKEN }}
body: |
## 以下为N1和HK1的最新固件(如遇上游更新,次日上午7时自动编译打包最新固件)
默认IP:192.168.1.99 默认密码: password
Openwrt🚀(注:此版本为jcnf个人的精简版。只有+o版,+o版为flowoffload加速)
N1和HK1在线升级方法:
1. cd /mnt/mmcblk2p4
2. wget 升级脚本链接,鼠标右击后缀.sh文件获取链接地址
3. wget img.gz后缀名的固件链接,鼠标右击后缀.img.gz文件获取链接地址
4. gzip -d 解压缩上一步下载的固件全名
5. chmod +x *.sh
6. ./升级脚本名字 img固件名
artifacts: "/opt/kernel/tmp/*"
- 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/delete-older-releases@v0.1.0
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=HK157+o打包成功"