Files
leaf/.github/workflows/tun2socks-build.yml
2020-10-19 08:27:59 +08:00

74 lines
2.2 KiB
YAML

name: tun2socks-build
on: [push, pull_request]
jobs:
build-bin-cross:
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- arm-unknown-linux-gnueabi
- arm-unknown-linux-musleabi
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
# - mips-unknown-linux-gnu
# - x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
runs-on: ubuntu-latest
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 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: |
cross build --target ${{ matrix.target }} -p tun2socks-bin --release
# - name: rename and compress artifacts
# if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
# run: |
# mv target/${{ matrix.target }}/release/tun2socks.exe tun2socks-${{ matrix.target }}.exe
- name: rename and compress artifacts
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
run: |
mv target/${{ matrix.target }}/release/tun2socks tun2socks-${{ matrix.target }}
# - name: upload assets
# if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
# uses: actions/upload-artifact@v2
# with:
# name: tun2socks-${{ matrix.target }}.exe
# path: tun2socks-${{ matrix.target }}.exe
- name: upload assets
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
uses: actions/upload-artifact@v2
with:
name: tun2socks-${{ matrix.target }}
path: tun2socks-${{ matrix.target }}