This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
88 lines (81 loc) · 4.28 KB
/
CI.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
name: CI
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
jobs:
build:
name: Build - ${{ matrix.target.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- arch: "aarch64_generic"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/rockchip/armv8/openwrt-sdk-22.03.5-rockchip-armv8_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a9"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/bcm53xx/generic/openwrt-sdk-22.03.5-bcm53xx-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a15"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/ipq806x/generic/openwrt-sdk-22.03.5-ipq806x-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a53"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/bcm27xx/bcm2710/openwrt-sdk-22.03.5-bcm27xx-bcm2710_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a72"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/bcm27xx/bcm2711/openwrt-sdk-22.03.5-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a7_neon-vfpv4"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/ipq40xx/generic/openwrt-sdk-22.03.5-ipq40xx-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "x86_64"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/openwrt-sdk-22.03.5-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "i386_pentium4"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/x86/generic/openwrt-sdk-22.03.5-x86-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "mips_74kc"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/ath79/generic/openwrt-sdk-22.03.5-ath79-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "mipsel_24kc"
sdk: "https://downloads.openwrt.org/releases/22.03.5/targets/ramips/mt7621/openwrt-sdk-22.03.5-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
steps:
- uses: actions/checkout@v2
- name: Install build requirements
run: |
sudo apt-get update
sudo apt-get install -y build-essential ccache ecj fastjar file g++ gawk \
gettext git java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python3 unzip wget \
python3-distutils python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev
- name: Install OpenWrt SDK
run: |
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz && tar -xvf openwrt-sdk.tar
mv -f openwrt-sdk-* openwrt-sdk
- name: Build Package
run: |
echo "src-link netbird $GITHUB_WORKSPACE" > openwrt-sdk/feeds.conf
echo 'CONFIG_PACKAGE_netbird=y
' >> openwrt-sdk/.config
cd openwrt-sdk
git clone https://github.com/kuoruan/openwrt-upx.git package/upx
git -C package/upx checkout 2c2ee0d696ea6084bee893a2861a7ed0729728ed # upx version: v2022-10-20
#cat feeds.conf.default >> feeds.conf
echo 'src-git packages https://git.openwrt.org/feed/packages.git^8939b43659dabe9b737feee02976949ad0355adc' >> feeds.conf # feeds/packages: OpenWrt v23.05.0-rc2
cat feeds.conf
./scripts/feeds update -a > /dev/null
rm -rf ./feeds/packages/net/netbird
make defconfig
./scripts/feeds install -d y -f -a
make package/netbird/compile V=s CONFIG_NETBIRD_COMPRESS_UPX=y
tree bin/packages/
- name: Archive package
uses: actions/upload-artifact@v2
with:
name: netbird-${{ matrix.target.arch }}
path: openwrt-sdk/bin/packages/*/netbird/netbird*.ipk
if-no-files-found: error
- name: Upload package to GitHub Release
uses: svenstaro/upload-release-action@v2
if: "startsWith(github.ref, 'refs/tags/')"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
overwrite: true
file: openwrt-sdk/bin/packages/*/netbird/netbird*.ipk
tag: ${{ github.ref }}