-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (78 loc) · 2.82 KB
/
Copy pathBuild_OP_SSH.yml
File metadata and controls
94 lines (78 loc) · 2.82 KB
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
# modify @2023-02-18
name: Build_OP
on:
push:
branches:
- ssh
#paths:
#- '.config'
# schedule:
# - cron: 0 8 * * 5
#watch:
#types: started
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
UPLOAD_BIN_DIR: false
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-18.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@master
- name: 初始化环境
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/mysql /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo -E apt-get -qq update
sudo -E apt-get -qq install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf swig
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
- name: 克隆源码
run: git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt
- name: 安装PLUS
run: cd openwrt && git clone https://github.com/fw876/helloworld package/openwrt-packages/helloworld
- name: 更新feeds
run: cd openwrt && ./scripts/feeds update -a
- name: 安装feeds
run: cd openwrt && ./scripts/feeds install -a
- name: SSH connection to Actions
uses: 82kg/debugger-action@master
- name: 下载所有包
id: package
run: |
cd openwrt
make defconfig
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: 开始编译固件
id: compile
run: |
cd openwrt
echo -e "$(nproc) thread compile"
make -j$(nproc) || make -j1 V=s
echo "::set-output name=status::success"
- name: 上传编译后的bin包
uses: actions/upload-artifact@master
if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true'
with:
name: OpenWrt_bin
path: openwrt/bin
- name: 组装编译后的固件
id: organize
working-directory: ./openwrt
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
find ./bin/targets/ -name "*combined.img*" | xargs -i mv -f {} ./artifact/
find ./bin/targets/ -name "*config*" | xargs -i mv -f {} ./artifact/
- name: 上传固件
uses: actions/upload-artifact@master
with:
name: OpenWrt_firmware
path: openwrt/artifact