forked from vgist/OpenWrt-Autobuild
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (105 loc) · 3.94 KB
/
k2p-blob.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
name: Phicomm K2P blob
on:
repository_dispatch:
types: Phicomm-K2P
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
ref: master
- name: Init build dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E swapoff -a
sudo -E rm -f /swapfile
sudo -E docker image prune -a -f
sudo -E snap set system refresh.retain=2
sudo -E apt-get -y purge azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu*
sudo -E apt-get -y autoremove --purge
sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android/sdk /etc/mysql /etc/php /usr/local/share/boost
[ -n "$AGENT_TOOLSDIRECTORY" ] && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo -E apt-get update -y
sudo -E apt-get install -y build-essential rsync asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core 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 python3 python3-pip python3-ply haveged lrzsz device-tree-compiler scons
wget -qO - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | sed 's/python-/python3-/g' | /bin/bash
sudo -E apt-get clean
git config --global user.name 'GitHub Actions' && git config --global user.email '[email protected]'
df -h
- name: Clone OpenWrt
id: co
run: |
REPO_URL=https://github.com/openwrt/openwrt
REPO_TAG=v21.02.1
git clone -b $REPO_TAG $REPO_URL openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
name_tag=${REPO_TAG}
echo ::set-output name=release_tag::$name_tag
- name: Feeds update
working-directory: ./openwrt
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Customize Packages
working-directory: ./openwrt
run: |
cp ../scripts/k2p_customization.sh .
/bin/bash k2p_customization.sh
cp ../scripts/00_customize_packages.sh .
/bin/bash 00_customize_packages.sh
- name: Convert Translation
working-directory: ./openwrt
run: |
cp ../scripts/01_convert_translation.sh .
/bin/bash 01_convert_translation.sh
- name: Add ACL
working-directory: ./openwrt
run: |
cp ../scripts/02_create_acl_for_luci.sh .
/bin/bash 02_create_acl_for_luci.sh -a
- name: Cache toolchain
uses: klever1988/cachewrtbuild@main
with:
ccache: 'true'
prefix: ${{ github.workspace }}/openwrt
- name: Make Config
working-directory: ./openwrt
run: |
cp ../config/k2p_defconfig .config
make defconfig
- name: Make Download
working-directory: ./openwrt
run: |
make download -j`nproc`
- name: Compile OpenWrt
working-directory: ./openwrt
run: |
make -j`nproc` || make -j1 V=s
- name: Assemble Artifact
run: |
rm -rf ./artifact
ls openwrt/bin/targets/ramips/mt7621/
mv openwrt/bin/targets/ramips/mt7621 ./artifact
pushd artifact
cat config.buildinfo
rm -rf packages *.buildinfo *.manifest *kernel.bin sha256sums
filename=`ls *sysupgrade.bin`
mv $filename ${filename/phicomm_k2p/phicomm_k2p_blob}
popd
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.co.outputs.release_tag }}
path: artifact/*
- name: Upload Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: true
tag_name: ${{ steps.co.outputs.release_tag }}
files: artifact/*