116 lines
3.6 KiB
YAML
116 lines
3.6 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: build with GCC toolchains
|
|
|
|
# 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:
|
|
|
|
# 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-22.04
|
|
|
|
# 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 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/build_helper.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
|
|
cd magisk
|
|
zip -q -r ../zerotier-magisk-aarch64-gcc.zip .
|
|
|
|
- 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
|
|
cd magisk
|
|
zip -q -r ../zerotier-magisk-aarch64-gcc-SSO.zip .
|
|
|
|
- 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/
|
|
cd magisk
|
|
zip -q -r ../zerotier-magisk-arm-gcc.zip .
|
|
|
|
- name: Get Date
|
|
id: date
|
|
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
files: |
|
|
zerotier-magisk-aarch64-gcc-SSO.zip
|
|
zerotier-magisk-aarch64-gcc.zip
|
|
zerotier-magisk-arm-gcc.zip
|
|
tag_name: SNAPSHOT-GCC-${{ steps.date.outputs.date }}
|
|
name: SNAPSHOT-GCC-${{ steps.date.outputs.date }}
|
|
draft: false
|
|
prerelease: true
|
|
|
|
# - name: Debugging with tmate
|
|
# uses: mxschmitt/action-tmate@v3.18
|