forked from ntop/n2n
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (90 loc) · 2.65 KB
/
openwrt.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
---
name: Openwrt Build
# yamllint disable-line rule:truthy
on:
release:
types:
- published
- created
- edited
push:
branches:
- openwrt
workflow_dispatch:
jobs:
build:
name: Build ipkg
runs-on: ubuntu-latest
defaults:
run:
working-directory: openwrt
steps:
- name: Checkout openwrt
uses: actions/checkout@v3
with:
path: openwrt
repository: openwrt/openwrt
- name: Set openwrt ref
run: |
echo "OPENWRT_REF=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
git rev-parse --short HEAD
- name: Checkout n2n
uses: actions/checkout@v2
with:
path: n2n
fetch-depth: 0
- name: Fix Checkout
run: |
git fetch --force --tags
working-directory: n2n
- name: Set n2n ref
run: |
echo "N2N_REF=$(./scripts/version.sh)" >> $GITHUB_ENV
./scripts/version.sh
working-directory: n2n
- name: Copy n2n package definition into openwrt
run: |
cp -r n2n/packages/openwrt openwrt/package/n2n
working-directory: ./
- name: Cache openwrt source downloads
uses: actions/cache@v3
with:
path: openwrt/dl
key: openwrt-dl-${{ env.OPENWRT_REF }}
- name: Setup openwrt config and environment
run: |
echo "CONFIG_TARGET_x86=y" >.config
echo "CONFIG_TARGET_x86_64=y" >>.config
- name: Add n2n package to openwrt config
run: |
echo "CONFIG_PACKAGE_n2n-edge=m" >>.config
echo "CONFIG_PACKAGE_n2n-supernode=m" >>.config
- name: Build a full config from our stub file
run: |
make defconfig
- name: Download openwrt sources
run: |
make download
- name: Build openwrt build environment
run: |
make -j `nproc` tools/install toolchain/install
- name: Build n2n dependancies
run: |
make -j `nproc` package/libs/libpcap/compile
- name: Build n2n openwrt packages
env:
N2N_PKG_VERSION: ${{ env.N2N_REF }}
run: |
echo "Build for $N2N_PKG_VERSION"
export N2N_PKG_VERSION
make package/n2n/clean V=s
make package/n2n/prepare USE_SOURCE_DIR=$GITHUB_WORKSPACE/n2n V=s
make package/n2n/compile V=s
# FIXME: add a way to run the test suite!
# - name: Run embedded tests
# run: make test
- name: Upload built artifacts
uses: actions/upload-artifact@v2
with:
name: built-ipkgs
path: openwrt/bin/packages/*/base/*.ipk