-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
805 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
protocol = "sparse" | ||
|
||
[build] | ||
#target = "aarch64-linux-android" | ||
# target = "aarch64-linux-android" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Check | ||
|
||
on: | ||
[push, pull_request] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add clippy | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu # arch: x86_64, os: linux | ||
- aarch64-unknown-linux-gnu # arch: aarch64 | ||
- armv7-unknown-linux-gnueabihf # arch: armv7 | ||
- x86_64-apple-darwin # os: darwin | ||
- aarch64-apple-darwin # os: darwin | ||
- x86_64-pc-windows-msvc # os: windows | ||
- i686-pc-windows-msvc | ||
|
||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
host_os: ubuntu-latest | ||
- target: aarch64-unknown-linux-gnu | ||
host_os: ubuntu-latest | ||
- target: armv7-unknown-linux-gnueabihf | ||
host_os: ubuntu-latest | ||
- target: x86_64-apple-darwin | ||
host_os: macos-latest | ||
- target: aarch64-apple-darwin | ||
host_os: macos-latest | ||
- target: x86_64-pc-windows-msvc | ||
host_os: windows-latest | ||
- target: i686-pc-windows-msvc | ||
host_os: windows-latest | ||
|
||
runs-on: ${{ matrix.host_os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare | ||
shell: bash | ||
run: | | ||
rustup target add ${{ matrix.target }} | ||
- name: Build | ||
shell: bash | ||
run: | | ||
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then | ||
sudo .github/workflows/install-cross.sh | ||
cross build --verbose --target ${{ matrix.target }} | ||
else | ||
cargo build --verbose --target ${{ matrix.target }} | ||
fi | ||
- name: Run tests | ||
run: cargo test --verbose --all-features | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Build Releases | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-unknown-linux-musl | ||
- aarch64-unknown-linux-gnu | ||
- armv7-unknown-linux-gnueabihf | ||
- x86_64-apple-darwin | ||
- aarch64-apple-darwin | ||
- x86_64-pc-windows-msvc | ||
- i686-pc-windows-msvc | ||
|
||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
host_os: ubuntu-latest | ||
- target: x86_64-unknown-linux-musl | ||
host_os: ubuntu-latest | ||
- target: aarch64-unknown-linux-gnu | ||
host_os: ubuntu-latest | ||
- target: armv7-unknown-linux-gnueabihf | ||
host_os: ubuntu-latest | ||
- target: x86_64-apple-darwin | ||
host_os: macos-latest | ||
- target: aarch64-apple-darwin | ||
host_os: macos-latest | ||
- target: x86_64-pc-windows-msvc | ||
host_os: windows-latest | ||
- target: i686-pc-windows-msvc | ||
host_os: windows-latest | ||
|
||
runs-on: ${{ matrix.host_os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare | ||
shell: bash | ||
run: | | ||
mkdir release | ||
rustup target add ${{ matrix.target }} | ||
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then | ||
sudo .github/workflows/install-cross.sh | ||
fi | ||
- name: Build | ||
shell: bash | ||
run: | | ||
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then | ||
cross build --all-features --release --target ${{ matrix.target }} | ||
else | ||
cargo build --all-features --release --target ${{ matrix.target }} | ||
fi | ||
cbindgen -c cbindgen.toml -l C -o target/${{ matrix.target }}/release/overtls-api.h | ||
if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then | ||
powershell Compress-Archive -Path target/${{ matrix.target }}/release/overtls.exe, ./config.json, target/${{ matrix.target }}/release/overtls-api.h, target/${{ matrix.target }}/release/overtls.dll -DestinationPath release/overtls-${{ matrix.target }}.zip | ||
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then | ||
zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls ./config.json target/${{ matrix.target }}/release/overtls-api.h target/${{ matrix.target }}/release/libovertls.dylib | ||
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then | ||
zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls ./config.json target/${{ matrix.target }}/release/overtls-api.h target/${{ matrix.target }}/release/libovertls.so | ||
fi | ||
- name: Upload | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: release/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
examples/ | ||
nginx_signing.key | ||
overtls-daemon.sh | ||
project.xcworkspace/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Building iOS framework | ||
|
||
### Install **Rust** build tools | ||
- Install Xcode Command Line Tools: `xcode-select --install` | ||
- Install Rust programming language: `curl https://sh.rustup.rs -sSf | sh` | ||
- Install iOS target support: `rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios` | ||
- Install `cbindgen` tool: `cargo install cbindgen` | ||
|
||
### Building iOS framework | ||
Due to an unknown reason at present, compiling Rust code from Xcode fails, so you have to manually compile it. | ||
Please run the following command in zsh (or bash): | ||
```bash | ||
cd overtls | ||
|
||
cargo build --release --target aarch64-apple-ios | ||
cargo build --release --target x86_64-apple-ios | ||
lipo -create target/aarch64-apple-ios/release/libovertls.a target/x86_64-apple-ios/release/libovertls.a -output target/libovertls.a | ||
cbindgen --config cbindgen.toml -l C -o target/overtls-ios.h | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[export] | ||
include = ["over_tls_client_run", "over_tls_client_stop"] | ||
include = ["over_tls_client_run", "over_tls_client_stop", "overtls_set_log_callback"] | ||
exclude = ["Java_com_github_shadowsocks_bg_OverTlsWrapper_runClient", "Java_com_github_shadowsocks_bg_OverTlsWrapper_stopClient"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.