-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (109 loc) · 4.18 KB
/
mt7621.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
# This is a basic workflow to help you get started with Actions
name: mt7621_CI
env:
REPO_URL: https://github.com/immortalwrt/immortalwrt.git
REPO_BRANCH: openwrt-21.02
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
permissions: write-all
# The type of runner that the job will run on
runs-on: ubuntu-20.04
env:
build_variant: ${{ matrix.build_variant }}
platform: ${{ matrix.platform }}
type: ${{ matrix.type }}
strategy:
matrix:
include:
- build_variant: mt7621-mini
platform: mt7621
type: mini
- build_variant: mt7621-full
platform: mt7621
type: full
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 512
temp-reserve-mb: 128
root-reserve-mb: 3072
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Checkout
uses: actions/checkout@main
- name: Init build dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt update -y
sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang clangd cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \
g++-multilib git gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev \
libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev \
libssl-dev libtool lld lldb lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 \
python3 python3-pip python3-ply python3-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig \
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
- name: Prepare
run: |
build_date="$(date +%Y%m%d)"
image_prefix=immortalwrt-${build_variant}-scutclient
echo "image_name=${image_prefix}-${build_date}" >> $GITHUB_ENV
echo "release_tag=immortalwrt-mt762x-scutclient-${build_date}">> $GITHUB_ENV
git clone --depth=1 -b $REPO_BRANCH $REPO_URL openwrt
cd openwrt
bash ../01_prepare.sh
#产生config文件,编译所有7621机器
cat ../mt7621_config.seed>.config
if [ "$type" == "full" ]; then
bash ../02_add_package.sh
fi
make defconfig
- name: Make Download
run: |
cd openwrt
make download -j50
- name: Compile
id: compileopenwrt
continue-on-error: true
run: |
cd openwrt
make -j$(nproc) || make -j1 V=s
- name: Package
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
if [ "$type" == "full" ]; then
mv openwrt/bin/targets/ramips/${platform}/immortalwrt*sysupgrade* ./artifact/
else
mv openwrt/bin/targets/ramips/${platform}/immortalwrt* ./artifact/
fi
cd artifact
7z a -mx=9 ../${{ env.image_name }}.7z .
- name: Create release
id: create_release
uses: ncipollo/release-action@v1.12.0
with:
name: ${{ env.release_tag }}
allowUpdates: true
prerelease: false
tag: ${{ env.release_tag }}
commit: main
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{env.image_name}}.7z