release v0.2.1
Some checks failed
build / build-bin-cross (ubuntu-latest, x86_64-pc-windows-gnu) (push) Has been cancelled
build / build-bin-local (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
build / build-bin-local (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
build / build-lib-ios (push) Has been cancelled
releases / build-bin-cross (ubuntu-latest, x86_64-pc-windows-gnu) (push) Has been cancelled
releases / build-bin-local (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
releases / build-bin-local (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
releases / build-lib-ios (push) Has been cancelled
releases / create-release (push) Has been cancelled
releases / release-bin (x86_64-apple-darwin) (push) Has been cancelled
releases / release-bin (x86_64-pc-windows-gnu) (push) Has been cancelled
releases / release-bin (x86_64-unknown-linux-gnu) (push) Has been cancelled
releases / release-lib (push) Has been cancelled

This commit is contained in:
eric
2020-10-07 22:27:55 +08:00
parent 897fc87ce8
commit 79b1c0c05d
3 changed files with 84 additions and 26 deletions

View File

@@ -1,8 +1,61 @@
name: build
# on: [push, pull_request]
on: [push, pull_request]
jobs:
build-bin-cross:
strategy:
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
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 docker
run: |
curl -fsSL https://get.docker.com | sudo bash
- name: install deps
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt update && sudo apt install make -y
- name: install cross
run: |
cargo install cross
- name: build
run: |
make ${{ matrix.target }}
- name: rename and compress artifacts
run: |
mv target/${{ matrix.target }}/release/leaf.exe leaf-${{ matrix.target }}.exe
# upx --brute leaf-${{ matrix.target }}
- name: upload assets
uses: actions/upload-artifact@v2
with:
name: leaf-${{ matrix.target }}.exe
path: leaf-${{ matrix.target }}.exe
build-bin-local:
strategy:
matrix:
@@ -21,9 +74,9 @@ jobs:
with:
submodules: true
- name: update submodule
run: |
git submodule init && git submodule update
# - name: update submodule
# run: |
# git submodule init && git submodule update
- name: show last commit
run: |
@@ -37,26 +90,27 @@ jobs:
- name: install llvm
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update && brew install llvm
brew update && brew install llvm protobuf upx
- name: install llvm
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt update && sudo apt install llvm-dev libclang-dev clang -y
sudo apt update && sudo apt install llvm-dev libclang-dev clang libssl-dev pkg-config protobuf-compiler upx -y
- name: build
run: |
cargo build --release --target ${{ matrix.target }} -p tun2socks-bin
cargo build --release --target ${{ matrix.target }} -p leaf-bin
- name: rename artifacts
- name: rename and compress artifacts
run: |
mv target/${{ matrix.target }}/release/tun2socks tun2socks-${{ matrix.target }}
mv target/${{ matrix.target }}/release/leaf leaf-${{ matrix.target }}
# upx --brute leaf-${{ matrix.target }}
- name: upload assets
uses: actions/upload-artifact@v2
with:
name: tun2socks-${{ matrix.target }}
path: tun2socks-${{ matrix.target }}
name: leaf-${{ matrix.target }}
path: leaf-${{ matrix.target }}
build-lib-ios:
runs-on: macos-latest
@@ -67,9 +121,9 @@ jobs:
with:
submodules: true
- name: update submodule
run: |
git submodule init && git submodule update
# - name: update submodule
# run: |
# git submodule init && git submodule update
- name: show last commit
run: |
@@ -80,9 +134,9 @@ jobs:
xcodebuild -version
xcrun --sdk iphoneos --show-sdk-path
- name: build openssl
run: |
./misc/build_ios_openssl.sh
# - name: build openssl
# run: |
# ./misc/build_ios_openssl.sh
- name: install rust
uses: hecrj/setup-rust-action@v1
@@ -94,27 +148,28 @@ jobs:
rustup target add aarch64-apple-ios
cargo install cargo-lipo
cargo install cbindgen
brew update && brew install llvm && brew install unzip
brew update && brew install llvm unzip protobuf
- name: build
run: |
OPENSSL_DIR=/tmp/openssl-ios64 cargo lipo --release -p tun2socks-mobile --targets aarch64-apple-ios
# OPENSSL_DIR=/tmp/openssl-ios64 cargo lipo --release -p leaf-mobile --targets aarch64-apple-ios
cargo lipo --release -p leaf-mobile --targets aarch64-apple-ios
- name: generate header
run: |
cbindgen tun2socks-mobile/src/lib.rs -l c > tun2socks.h
cbindgen leaf-mobile/src/lib.rs -l c > leaf.h
- name: zip artifacts
run: |
mv target/universal/release/libtun2socks.a .
zip libtun2socks-ios.zip tun2socks.h libtun2socks.a
mv target/universal/release/libleaf.a .
zip libleaf-ios.zip leaf.h libleaf.a
- name: verify zip artifacts
run: |
unzip -l libtun2socks-ios.zip
unzip -l libleaf-ios.zip
- name: upload assets
uses: actions/upload-artifact@v2
with:
name: libtun2socks-ios.zip
path: libtun2socks-ios.zip
name: libleaf-ios.zip
path: libleaf-ios.zip