-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 3.18 KB
/
build.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
name: build_6.0
on:
repository_dispatch:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Space cleanup
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo sysctl vm.swappiness=0
nohup sudo rm -rf /usr/share/dotnet /usr/local/lib/android/sdk &
sudo -E apt update
nohup sudo -E apt -y --no-install-recommends install pv jq build-essential cmake asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python2.7 python3 python3-pip python-ply python3-ply haveged lrzsz device-tree-compiler scons antlr3 gperf intltool mkisofs rsync swig &
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Generate firmware
run: |
sudo apt update && sudo apt install qemu-utils
sudo sysctl vm.swappiness=0
ulimit -SHn 65000
curl -L https://github.com/00575/cache-build/releases/download/cache/ib-r4s.tar.xz | tar -Jxvf -
mv *imagebuilder* ib && cd ib
. $GITHUB_WORKSPACE/scripts/merge_files.sh
mkdir -p files/local_feed && sudo mount --bind packages files/local_feed
sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile)
sed -i 's/$(OPKG) install $(BUILD_PACKAGES)/$(OPKG) install --force-overwrite $(BUILD_PACKAGES)/' Makefile
ls packages/*.ipk | xargs -n1 basename > package.files
PACKAGES=$(cat $GITHUB_WORKSPACE/r4s.config.seed $GITHUB_WORKSPACE/common.seed | grep CONFIG_PACKAGE | grep -v CONFIG_PACKAGE_luci-app | sed 's/CONFIG_PACKAGE_//;s/=y//' | xargs -n1 -i grep -o {} package.files | sort -u | xargs echo)
PACKAGES="$PACKAGES `grep -o luci-i18n-opkg-zh-cn package.files || true`"
make image PACKAGES="$PACKAGES $LUCI $LP luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn" FILES="files"
mkdir -p $GITHUB_WORKSPACE/release
mv $(ls -1 ./bin/targets/*/*/*img.gz | head -1) $GITHUB_WORKSPACE/release/r4s-slim.img.gz
cd $GITHUB_WORKSPACE/release/ && md5sum r4s-slim.img.gz > r4s-slim.img.gz.md5
gzip -dc r4s-slim.img.gz | md5sum | sed "s/-/r4s-slim.img/" > r4s-slim.img.md5
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
echo "strDevice=$(echo r4s | awk '{print toupper($0)}')" >> $GITHUB_ENV
- name: Deliver firmware
uses: actions/upload-artifact@v2
with:
name: 自编译固件
path: ./release/
- name: Upload release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.workflow_token }}
file: ./release/*
tag: ${{env.strDate}}_5.15.x
file_glob: true
overwrite: true
release_name: ${{env.strDate}}发布
body: "6.0内核编译R4S纯净固件"