Files
leaf/.github/workflows/build.yml
eric 807ad5ab5e Added several inbounds
* Added WebSocket inbound
* Added trojan inbound
* Added chain inbound

Similar to the chain outbound, chain inbound can be used to chain
multiple inbounds. The Nginx/CDN (TLS) + WebSocket + trojan setup is tested.

There are also breaking changes to the JSON config format.

Fake DNS now can operate in either Include or Exclude mode.

SOCKS inbound settings no longer has the `bind` option, the local_addr of
the TCP socket is used as the UDP relay address.
2020-12-18 13:08:50 +08:00

160 lines
4.2 KiB
YAML

name: build
on: [push, pull_request]
jobs:
build-bin-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- mips-unknown-linux-musl
- mips-unknown-linux-gnu
#- mips64-unknown-linux-gnuabi64
- mipsel-unknown-linux-musl
- mipsel-unknown-linux-gnu
#- mipsel64-unknown-linux-gnuabi64
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- i686-unknown-linux-musl
- i686-unknown-linux-gnu
- aarch64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- arm-unknown-linux-musleabi
- arm-unknown-linux-gnueabi
- armv7-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf
#- i686-pc-windows-gnu
- x86_64-pc-windows-gnu
steps:
- name: checkout
uses: actions/checkout@v2
with:
submodules: true
- name: install rust toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- name: install deps
run: |
sudo apt update && sudo apt install llvm-dev libclang-dev clang libssl-dev pkg-config protobuf-compiler make -y
- name: install cross
run: |
cargo install cross
- name: build
run: |
./misc/build_cross.sh ${{ matrix.target }}
- name: rename and compress artifacts
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
run: |
mv target/${{ matrix.target }}/release/leaf.exe leaf-${{ matrix.target }}.exe
- name: rename and compress artifacts
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
run: |
mv target/${{ matrix.target }}/release/leaf leaf-${{ matrix.target }}
- name: upload assets
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
uses: actions/upload-artifact@v2
with:
name: leaf-${{ matrix.target }}.exe
path: leaf-${{ matrix.target }}.exe
- name: upload assets
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
uses: actions/upload-artifact@v2
with:
name: leaf-${{ matrix.target }}
path: leaf-${{ matrix.target }}
build-bin-local:
strategy:
matrix:
os: [macos-latest]
include:
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
with:
submodules: true
- name: show last commit
run: |
git show --summary
- name: install rust toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- name: install llvm
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update && brew install llvm protobuf
- name: build
run: |
cargo build --release --target ${{ matrix.target }} -p leaf-bin
- name: rename and compress artifacts
run: |
mv target/${{ matrix.target }}/release/leaf leaf-${{ matrix.target }}
- name: upload assets
uses: actions/upload-artifact@v2
with:
name: leaf-${{ matrix.target }}
path: leaf-${{ matrix.target }}
build-lib-ios:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
submodules: true
- name: install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- name: install toolchain
run: |
rustup target add aarch64-apple-ios
cargo install cargo-lipo
cargo install cbindgen
brew update && brew install llvm unzip protobuf
- name: build
run: |
# OPENSSL_DIR=/tmp/openssl-ios64 cargo lipo --release -p leaf-mobile --targets aarch64-apple-ios
make ios
- name: zip artifacts
run: |
mv target/universal/release/libleaf.a .
mv target/universal/release/leaf.h .
zip libleaf-ios.zip leaf.h libleaf.a
- name: upload assets
uses: actions/upload-artifact@v2
with:
name: libleaf-ios.zip
path: libleaf-ios.zip