83 lines
2.8 KiB
YAML
83 lines
2.8 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: build
|
|
|
|
# Controls when the workflow will run
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the "master" branch
|
|
# push:
|
|
# branches: [ "master" ]
|
|
# pull_request:
|
|
# branches: [ "master" ]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
api_version: 21 # min. 21
|
|
ndk: r26d # android-ndk-$ndk-linux.zip
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
# This workflow contains a single job called "build"
|
|
build:
|
|
# The type of runner that the job will run on
|
|
runs-on: ubuntu-latest
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- name: Checkout zerotier-magisk
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Checkout ZeroTierOne
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: zerotier/ZeroTierOne
|
|
path: ZeroTierOne
|
|
|
|
# Runs a single command using the runners shell
|
|
- name: Prepare NDK Toolchain
|
|
run: |
|
|
wget -qO ndk.zip https://dl.google.com/android/repository/android-ndk-$ndk-linux.zip
|
|
unzip -qq ndk.zip "android-ndk-$ndk/toolchains/*" && rm ndk.zip -f
|
|
|
|
- name: Build for aarch64
|
|
run: |
|
|
PATH=`pwd`/android-ndk-$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
|
|
|
|
CC=aarch64-linux-android$api_version-clang
|
|
CXX=aarch64-linux-android$api_version-clang++
|
|
|
|
# "-D__GLIBC__=0" is a bypass, see zerotier/ZeroTierOne#2289
|
|
cd ZeroTierOne
|
|
make -j $(nproc) ZT_DEBUG=0 ZT_SSO_SUPPORTED=0 CC=$CC CXX=$CXX LDFLAGS="-L../deps/aarch64" DEFS="-I../deps/include -D__GLIBC__=0"
|
|
cd ..
|
|
|
|
mkdir -p magisk/zerotier/lib
|
|
mv ZeroTierOne/zerotier-one magisk/zerotier
|
|
mv deps/aarch64/lic++_shared.so magisk/zerotier/lib
|
|
cd magisk
|
|
zip -q -r ../zerotier-magisk-aarch64.zip .
|
|
|
|
make clean
|
|
|
|
- name: Build for arm
|
|
run: |
|
|
PATH=`pwd`/android-ndk-$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
|
|
|
|
CC=armv7a-linux-androideabi$api_version-clang
|
|
CXX=armv7a-linux-androideabi$api_version-clang++
|
|
|
|
cd ZeroTierOne
|
|
make -j $(nproc) ZT_DEBUG=0 ZT_SSO_SUPPORTED=0 CC=$CC CXX=$CXX LDFLAGS="-L../deps/arm" DEFS="-I../deps/include -D__GLIBC__=0"
|
|
cd ..
|
|
|
|
mv ZeroTierOne/zerotier-one magisk/zerotier/
|
|
mv deps/arm/lic++_shared.so magisk/zerotier/lib/
|
|
cd magisk
|
|
zip -q -r ../zerotier-magisk-arm.zip .
|
|
|
|
- name: Debugging with tmate
|
|
uses: mxschmitt/action-tmate@v3.18
|