forked from amnezia-vpn/amneziawg-openwrt
-
Notifications
You must be signed in to change notification settings - Fork 336
133 lines (107 loc) · 4.78 KB
/
build-module.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
name: Release AmneziaWG Kernel Module
on: [workflow_dispatch]
# on:
# push:
# tags:
# - "v*.*.*"
jobs:
build:
name: "${{ matrix.tag }} - ${{ matrix.build_env.pkgarch}} :: ${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}} build"
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['v23.05.0']
build_env:
- pkgarch: mipsel_24kc
target: ramips
subtarget: mt7621
steps:
- uses: actions/checkout@v4
with:
repository: openwrt/openwrt
ref: ${{ matrix.tag }}
fetch-depth: 0
- name: Cache Tools and Kernel
id: cache-tools-kernel
uses: actions/cache@v3
env:
cache-name: "cache-tools-kernel-${{ matrix.tag }}-${{ matrix.build_env.pkgarch}}-${{ matrix.build_env.target}}-${{ matrix.build_env.subtarget}}"
with:
path: .
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-cache-tools-kernel-${{ matrix.tag }}-${{ matrix.build_env.pkgarch}}-
${{ runner.os }}-build-cache-tools-kernel-${{ matrix.tag }}-
${{ runner.os }}-build-
- name: Building kernel and tools
if: ${{ steps.cache-tools-kernel.outputs.cache-hit != 'true' }}
run: |
pkgarch=${{ matrix.build_env.pkgarch}}
target=${{ matrix.build_env.target}}
subtarget=${{ matrix.build_env.subtarget}}
echo "pkgarch: ${pkgarch}, target: ${target}, subtarget: ${subtarget}"
echo "CONFIG_TARGET_${target}=y" > .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_DEFAULT_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_ALL_KMODS=y" >> .config
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_amnezia-wg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-chacha20poly1305=m" >> .config
make defconfig
echo " > make tools/install"
make tools/install -i -j `nproc`
echo " > make toolchain/install"
make toolchain/install -i -j `nproc`
# compile kernel module
echo " > make target/linux/compile"
make target/linux/compile -i -j `nproc` V=s
- name: Update feeds
run: |
cp feeds.conf.default feeds.conf
echo "src-git awgopenwrt https://github.com/yury-sannikov/awg-openwrt.git" >> ./feeds.conf
./scripts/feeds update luci
./scripts/feeds install -a -p luci
./scripts/feeds update awgopenwrt
./scripts/feeds install -a -p awgopenwrt
pkgarch=${{ matrix.build_env.pkgarch}}
target=${{ matrix.build_env.target}}
subtarget=${{ matrix.build_env.subtarget}}
echo "pkgarch: ${pkgarch}, target: ${target}, subtarget: ${subtarget}"
echo "CONFIG_TARGET_${target}=y" > .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_DEFAULT_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_ALL_KMODS=y" >> .config
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_amnezia-wg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-chacha20poly1305=m" >> .config
make defconfig
cat .config
# - name: Build amnezia-wg-tools
# run: |
# make package/amnezia-wg-tools/{clean,download,prepare}
# make package/amnezia-wg-tools/compile
# - name: Build kmod-amneziawg
# run: |
# make package/kmod-amneziawg/{clean,download,prepare}
# make package/kmod-amneziawg/compile
- name: Build luci
run: |
cat .config | grep luci-app-amneziawg || true
make package/luci-app-amneziawg/{clean,download,prepare}
make package/luci-app-amneziawg/compile V=s
- name: LS Packages
run: |
rm feeds.conf
# ls -al bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt
# ls -al bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: |
# bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/kmod-amneziawg*.ipk