build with GCC toolchains #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |