feat: local-tun compilable for not-supported platforms

- Prepare for v1.19.0 release. Upgraded MSRV to 1.74
- "default" build feature now contains only basic shadowsocks features
  (BREAKING)
- Add "full" build feature for all suggested features
- Add "full-extra" build feature for including *-extra features
This commit is contained in:
zonyitoo
2024-05-24 23:13:14 +08:00
parent 2a46083553
commit ba8e07e769
23 changed files with 289 additions and 80 deletions
+7 -3
View File
@@ -33,6 +33,10 @@ jobs:
rustup override set stable
- name: Build & Test (Default)
run: cargo test --verbose --no-fail-fast
- name: Build & Test (full)
run: cargo test --features "full" --verbose --no-fail-fast
- name: Build & Test (full-extra)
run: cargo test --features "full-extra" --verbose --no-fail-fast
- name: Build & Test (Default) - shadowsocks
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-fail-fast
- name: Build & Test (--no-default-features)
@@ -41,9 +45,9 @@ jobs:
run: cargo test --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --no-default-features --no-fail-fast
- name: Build with All Features Enabled (Unix)
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun local-online-config dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline"
- name: Build with All Features Enabled (Windows)
if: ${{ runner.os == 'Windows' }}
run: cargo build --verbose --features "local-http-rustls local-dns local-tun local-online-config dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect winservice"
run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline winservice"
- name: Build with All Features Enabled - shadowsocks
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-2022"
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
+3 -3
View File
@@ -28,9 +28,9 @@ jobs:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install 1.71
rustup default 1.71
rustup override set 1.71
rustup toolchain install 1.74
rustup default 1.74
rustup override set 1.74
- name: Build with All Features Enabled (Unix)
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun local-online-config dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
+4 -6
View File
@@ -38,12 +38,10 @@ jobs:
run: |
compile_target=${{ matrix.target }}
if [[ "$compile_target" == *"-linux-"* || "$compile_target" == *"-apple-"* ]]; then
compile_features="-f local-redir -f local-tun"
fi
compile_features="-f full"
if [[ "$compile_target" == *"-windows-"* ]]; then
compile_features="-f winservice -f local-tun"
compile_features="$compile_features -f winservice"
fi
if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then
@@ -65,7 +63,7 @@ jobs:
build-unix:
runs-on: ${{ matrix.os }}
env:
BUILD_EXTRA_FEATURES: "local-redir local-tun"
BUILD_EXTRA_FEATURES: "full"
RUST_BACKTRACE: full
strategy:
fail-fast: false
@@ -129,7 +127,7 @@ jobs:
- name: Build release
run: |
pwsh ./build/build-host-release.ps1 "winservice local-tun"
pwsh ./build/build-host-release.ps1 "full winservice"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
+4 -6
View File
@@ -54,12 +54,10 @@ jobs:
run: |
compile_target=${{ matrix.target }}
if [[ "$compile_target" == *"-linux-"* || "$compile_target" == *"-apple-"* ]]; then
compile_features="-f local-redir -f local-tun"
fi
compile_features="-f full"
if [[ "$compile_target" == *"-windows-"* ]]; then
compile_features="-f winservice -f local-tun"
compile_features="$compile_features -f winservice"
fi
if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then
@@ -84,7 +82,7 @@ jobs:
build-unix:
runs-on: ${{ matrix.os }}
env:
BUILD_EXTRA_FEATURES: "local-redir local-tun"
BUILD_EXTRA_FEATURES: "full"
RUST_BACKTRACE: full
strategy:
fail-fast: false
@@ -152,7 +150,7 @@ jobs:
- name: Build release
run: |
pwsh ./build/build-host-release.ps1 "winservice local-tun"
pwsh ./build/build-host-release.ps1 "full winservice"
- name: Upload Github Assets
uses: softprops/action-gh-release@v1
+2 -7
View File
@@ -32,16 +32,11 @@ jobs:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly --component clippy
rustup default nightly
rustup override set nightly
rustup toolchain install stable --component clippy
- name: Clippy Check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: |
--features "local-http-rustls local-redir local-flow-stat local-dns local-tun local-fake-dns local-online-config dns-over-tls dns-over-https stream-cipher aead-cipher-2022" -- -Z macro-backtrace
-W clippy::absurd_extreme_comparisons
-W clippy::erasing_op
-A clippy::collapsible_else_if
--features "full-extra local-flow-stat utility-url-outline"
name: clippy ${{ matrix.platform }}