name: Build and Release run-name: ${{ startsWith(github.ref, 'refs/tags/v') && format('Release {0}', github.ref_name) || null }} on: workflow_dispatch: push: tags: - v[0-9]+* jobs: build-linux: name: Build Linux runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - arch: arm64 tool: aarch64-unknown-linux-musl - arch: x86_64 tool: x86_64-unknown-linux-musl - arch: lexra tool: mips-linux dir: rsdk-4.6.4-5281-EB-3.10-0.9.33-m32ub-20141001 env: CFLAGS: '-march=5281' LDFLAGS: '-lgcc_eh' repo: 'bol-van/build' steps: - name: Checkout uses: actions/checkout@v4 with: path: zapret - name: Set up build tools env: ARCH: ${{ matrix.arch }} TOOL: ${{ matrix.tool }} REPO: ${{ matrix.arch == 'lexra' && matrix.repo || 'spvkgn/musl-cross' }} DIR: ${{ matrix.arch == 'lexra' && matrix.dir || matrix.tool }} run: | sudo apt update -qq sudo apt install -y libcap-dev if [[ "$ARCH" == lexra ]]; then sudo dpkg --add-architecture i386 sudo apt install -y libc6:i386 zlib1g:i386 URL=https://github.com/$REPO/raw/refs/heads/master/$DIR.txz else URL=https://github.com/$REPO/releases/download/latest/$TOOL.tar.xz fi mkdir -p $HOME/tools wget -qO- $URL | tar -C $HOME/tools -xJ echo "$HOME/tools/$DIR/bin" >> $GITHUB_PATH - name: Build Project env: ARCH: ${{ matrix.arch }} TARGET: ${{ matrix.tool }} CFLAGS: ${{ matrix.env.CFLAGS || '' }} LDFLAGS: ${{ matrix.env.LDFLAGS || '' }} run: | # Export environment variables export CC="$TARGET-gcc" export LD=$TARGET-ld export AR=$TARGET-ar export NM=$TARGET-nm export STRIP=$TARGET-strip # Build netfilter dependencies for lib in libmnl libnfnetlink libnetfilter_queue; do wget -qO- https://www.netfilter.org/pub/$lib/$lib-1.0.5.tar.bz2 | tar -xj cd $lib-* ./configure --host=$TARGET --enable-static --disable-shared make install DESTDIR=$GITHUB_WORKSPACE/deps cd .. done # Build zapret make -C zapret -j$(nproc) tar -C zapret/binaries/my -cJf zapret-linux-$ARCH.tar.xz . - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: zapret-linux-${{ matrix.arch }} path: zapret-linux-${{ matrix.arch }}.tar.xz # Additional jobs for macOS, Windows, FreeBSD, and Android follow the same pattern