-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (79 loc) · 2.51 KB
/
makecfg-r68s-im.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
# Description: 此脚本基于 P3TERX 的 Actions-OpenWrt 仓库修改而来。
# 用于生成config配置文件
name: MakeCfg-R68s-Im
on:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: true
default: 'true'
env:
REPO_URL: https://github.com/immortalwrt/immortalwrt.git
REPO_BRANCH: openwrt-24.10
DEVICE_NAME: R68s-Im
FILES: immortalwrt/files
FEEDS_CONF: immortalwrt/feeds.conf.default
CONFIG_FILE: immortalwrt/config.r68s.bak
DIY_P1_SH: immortalwrt/diy-part1.sh
DIY_P2_SH: immortalwrt/diy-part2.sh
TZ: Asia/Shanghai
jobs:
config:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: 初始化编译环境
env:
DEBIAN_FRONTEND: noninteractive
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 -yqq install $(cat $GITHUB_WORKSPACE/depends-ubuntu-2004)
sudo -E apt-get -yqq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
- name: 克隆 openwrt 源码
working-directory: /workdir
run: |
df -hT $PWD
git clone $REPO_URL -b $REPO_BRANCH openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
- name: 加载自定义 feeds.conf 文件
run: |
[ -e $FEEDS_CONF ] && mv $FEEDS_CONF openwrt/feeds.conf.default
chmod +x $DIY_P1_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P1_SH
- name: 加载自定义配置文件
run: |
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
cd ..
[ -e $FILES ] && mv $FILES openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x $DIY_P2_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P2_SH
- name: SSH connection to Actions
uses: mxschmitt/action-tmate@v3
- name: 组织配置文件
run: |
cd openwrt
mkdir -p /tmp/upload
cp .config /tmp/upload
- name: 上传配置文件
uses: actions/upload-artifact@main
with:
name: OpenWrt-${{ env.DEVICE_NAME }}-Config
path: /tmp/upload
include-hidden-files: true
- name: 删除旧的 workflow 运行记录
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 30
keep_minimum_runs: 3