-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (73 loc) · 2.61 KB
/
build-gcc.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
name: build with GCC toolchains
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout zerotier-magisk
uses: actions/checkout@v4
- name: Checkout ZeroTierOne
uses: actions/checkout@v4
with:
repository: zerotier/ZeroTierOne
path: ZeroTierOne
- id: commit
uses: prompt/actions-commit-hash@v3
- name: Prepare GCC Toolchain
run: |
sudo apt-get install -qqy gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
rustup target add aarch64-unknown-linux-gnu
sudo dpkg --add-architecture arm64
sudo mv build/sources.list /etc/apt/sources.list
sudo apt-get update -qqy
sudo apt-get install -qqy libssl-dev:arm64
- name: Patch ZeroTier for Cross-Compile
run: |
pip3 install toml
python3 build/patch.py
- name: Build for AArch64
run: |
CC=aarch64-linux-gnu-gcc
CXX=aarch64-linux-gnu-g++
cd ZeroTierOne
mv make-linux.mk.aarch64 make-linux.mk
make clean
make --silent -j $(nproc) ZT_SSO_SUPPORTED=0 ZT_STATIC=1 ZT_DEBUG=0 CC=$CC CXX=$CXX LDFLAGS="-s"
cd ..
cp ZeroTierOne/zerotier-one magisk/zerotier
- name: Upload AArch64
uses: actions/upload-artifact@v4
with:
name: zerotier-magisk-aarch64-gcc-${{ steps.commit.outputs.short }}
path: magisk/
- name: Build for AArch64 with SSO
run: |
CC=aarch64-linux-gnu-gcc
CXX=aarch64-linux-gnu-g++
cd ZeroTierOne
make clean
make --silent -j $(nproc) ZT_STATIC=1 ZT_DEBUG=0 CC=$CC CXX=$CXX LDFLAGS="-s"
cd ..
cp ZeroTierOne/zerotier-one magisk/zerotier
- name: Upload AArch64 SSO
uses: actions/upload-artifact@v4
with:
name: zerotier-magisk-aarch64-gcc-SSO-${{ steps.commit.outputs.short }}
path: magisk/
- name: Build for Arm
run: |
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
FLAGS="-w -fcompare-debug-second"
cd ZeroTierOne
mv make-linux.mk.arm make-linux.mk
make clean
make --silent -j $(nproc) ZT_SSO_SUPPORTED=0 ZT_STATIC=1 ZT_DEBUG=0 CC=$CC CXX=$CXX LDFLAGS="-s"
cd ..
cp ZeroTierOne/zerotier-one magisk/zerotier/
- name: Upload Arm
uses: actions/upload-artifact@v4
with:
name: zerotier-magisk-arm-gcc-${{ steps.commit.outputs.short }}
path: magisk/