fix: remove unused imports/vars for cross-platform ci #9
This file contains hidden or 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
| name: Release v3.1 | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version tag (e.g., v3.1.0)' | ||
| required: true | ||
| default: 'v3.1.0' | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| jobs: | ||
| # Linux x86_64 | ||
| build-linux: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y musl-tools | ||
| - name: Add musl target | ||
| run: rustup target add x86_64-unknown-linux-musl | ||
| - name: Build release | ||
| shell: bash | ||
| run: | | ||
| cargo build --release --target x86_64-unknown-linux-musl \ | ||
| -p sush_daemon -p sush_core | ||
| strip target/x86_64-unknown-linux-musl/release/sush_daemon || true | ||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
| mkdir -p dist/linux-x86_64 | ||
| cp target/x86_64-unknown-linux-musl/release/sush_daemon dist/linux-x86_64/ | ||
| cp docs/SUSHDNS_TDD.md dist/linux-x86_64/DNS_GUIDE.md || true | ||
| cp docs/DNS_DEPLOY.md dist/linux-x86_64/ || true | ||
| echo "# Sample Configuration" > dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "# Server mode" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "sush_daemon run --mode socks5 --bind 0.0.0.0:8080 --secret YOUR_SECRET" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "# Client mode (UDP)" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "sush_daemon run --mode socks5 --server-ip YOUR_SERVER:8080 --secret YOUR_SECRET --transport udp" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "# Client mode (DNS fallback)" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "sush_daemon run --mode socks5 --server-ip YOUR_SERVER:53 --secret YOUR_SECRET --transport dns --dns-domain tunnel.yourdomain.com" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "# v3.1: Direct DNS mode" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| echo "sush_daemon run --mode socks5 --server-ip YOUR_SERVER:53 --secret YOUR_SECRET --transport dns --dns-direct --dns-direct-server YOUR_VPS:53" >> dist/linux-x86_64/SAMPLE_CONFIG.txt | ||
| cd dist && tar -czvf sushdns-v3.1.0-linux-x86_64.tar.gz linux-x86_64/ | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-x86_64 | ||
| path: dist/sushdns-v3.1.0-linux-x86_64.tar.gz | ||
| # Windows x86_64 | ||
| build-windows: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Build release | ||
| shell: bash | ||
| run: | | ||
| cargo build --release -p sush_daemon -p sush_core | ||
| strip target/release/sush_daemon.exe || true | ||
| - name: Package | ||
| shell: powershell | ||
| run: | | ||
| New-Item -ItemType Directory -Force -Path dist\windows-x86_64 | ||
| Copy-Item target\release\sush_daemon.exe dist\windows-x86_64\ | ||
| @" | ||
| # sushStream v3.0 for Windows | ||
| ## Quick Start | ||
| 1. Open PowerShell as Administrator | ||
| 2. Run server: .\sush_daemon.exe run --mode socks5 --bind 0.0.0.0:8080 --secret YOUR_SECRET | ||
| 3. Run client: .\sush_daemon.exe run --mode socks5 --server-ip SERVER:8080 --secret YOUR_SECRET | ||
| ## DNS Fallback Mode | ||
| .\sush_daemon.exe run --mode socks5 --server-ip SERVER:53 --secret YOUR_SECRET --transport dns --dns-domain tunnel.yourdomain.com | ||
| "@ | Out-File -FilePath dist\windows-x86_64\README.txt -Encoding utf8 | ||
| Compress-Archive -Path dist\windows-x86_64\* -DestinationPath dist\sushdns-v3.1.0-windows-x86_64.zip | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-x86_64 | ||
| path: dist/sushdns-v3.1.0-windows-x86_64.zip | ||
| # macOS x86_64 + ARM64 | ||
| build-macos: | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Add ARM64 target | ||
| run: rustup target add aarch64-apple-darwin | ||
| - name: Build x86_64 | ||
| shell: bash | ||
| run: cargo build --release -p sush_daemon -p sush_core | ||
| env: | ||
| CARGO_PROFILE_RELEASE_LTO: true | ||
| CARGO_PROFILE_RELEASE_STRIP: true | ||
| - name: Build ARM64 | ||
| shell: bash | ||
| run: cargo build --release --target aarch64-apple-darwin -p sush_daemon -p sush_core | ||
| env: | ||
| CARGO_PROFILE_RELEASE_LTO: true | ||
| CARGO_PROFILE_RELEASE_STRIP: true | ||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
| mkdir -p dist/macos-x86_64 dist/macos-arm64 | ||
| cp target/release/sush_daemon dist/macos-x86_64/ | ||
| cp target/aarch64-apple-darwin/release/sush_daemon dist/macos-arm64/ | ||
| cd dist && tar -czvf sushdns-v3.1.0-macos-x86_64.tar.gz macos-x86_64/ | ||
| tar -czvf sushdns-v3.1.0-macos-arm64.tar.gz macos-arm64/ | ||
| - name: Upload x86_64 | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-x86_64 | ||
| path: dist/sushdns-v3.1.0-macos-x86_64.tar.gz | ||
| - name: Upload ARM64 | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-arm64 | ||
| path: dist/sushdns-v3.1.0-macos-arm64.tar.gz | ||
| # Android aarch64 (using cargo-ndk) | ||
| build-android: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Setup Android NDK | ||
| uses: android-actions/setup-android@v3 | ||
| with: | ||
| ndk-version: "26.1.10909125" | ||
| - name: Install cargo-ndk | ||
| run: cargo install cargo-ndk | ||
| - name: Build for Android ARM64 | ||
| shell: bash | ||
| run: | | ||
| export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT | ||
| cargo ndk -t arm64-v8a build --release -p sush_core | ||
| continue-on-error: true | ||
| - name: Package (if build succeeded) | ||
| shell: bash | ||
| run: | | ||
| if [ -f target/aarch64-linux-android/release/libsush_core.so ]; then | ||
| mkdir -p dist/android-arm64 | ||
| cp target/aarch64-linux-android/release/*.so dist/android-arm64/ || true | ||
| cd dist && tar -czvf sushdns-v3.1.0-android-arm64.tar.gz android-arm64/ | ||
| else | ||
| echo "Android build not available - creating placeholder" | ||
| mkdir -p dist | ||
| echo "Android build requires NDK setup" > dist/android-arm64-notice.txt | ||
| tar -czvf dist/sushdns-v3.1.0-android-arm64.tar.gz dist/android-arm64-notice.txt | ||
| fi | ||
| continue-on-error: true | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android-arm64 | ||
| path: dist/sushdns-v3.1.0-android-arm64.tar.gz | ||
| continue-on-error: true | ||
| # Linux ARM64 (for Raspberry Pi, etc.) | ||
| build-linux-arm64: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Install cross | ||
| run: cargo install cross --git https://github.com/cross-rs/cross | ||
| - name: Build for Linux ARM64 | ||
| shell: bash | ||
| run: cross build --release --target aarch64-unknown-linux-gnu -p sush_daemon -p sush_core | ||
| env: | ||
| CARGO_PROFILE_RELEASE_LTO: true | ||
| CARGO_PROFILE_RELEASE_STRIP: true | ||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
| mkdir -p dist/linux-arm64 | ||
| cp target/aarch64-unknown-linux-gnu/release/sush_daemon dist/linux-arm64/ | ||
| strip target/aarch64-unknown-linux-gnu/release/sush_daemon || true | ||
| cd dist && tar -czvf sushdns-v3.1.0-linux-arm64.tar.gz linux-arm64/ | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-arm64 | ||
| path: dist/sushdns-v3.1.0-linux-arm64.tar.gz | ||
| # Create GitHub Release | ||
| release: | ||
| needs: [build-linux, build-windows, build-macos, build-linux-arm64] | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: sushDNS ${{ github.ref_name }} | ||
| body: | | ||
| ## sushDNS ${{ github.ref_name }} (Performance Edition) | ||
| ### What's New in v3.1 | ||
| - **Adaptive Zstd Compression**: Up to 22x speedup on compressible traffic | ||
| - **Direct DNS Mode**: Bypass public resolvers, send directly to VPS:53 | ||
| - **Zero Overhead**: Incompressible data passes through unchanged | ||
| - **Full v3.0 Compatibility**: Works with existing v3.0 servers | ||
| ### Downloads | ||
| - `sushdns-v3.1.0-linux-x86_64.tar.gz`: Standard Linux (static musl, LTO+strip) | ||
| - `sushdns-v3.1.0-linux-arm64.tar.gz`: Raspberry Pi, ARM servers | ||
| - `sushdns-v3.1.0-windows-x86_64.zip`: Windows 10/11 | ||
| - `sushdns-v3.1.0-macos-x86_64.tar.gz`: Intel Macs | ||
| - `sushdns-v3.1.0-macos-arm64.tar.gz`: Apple Silicon (M1/M2/M3) | ||
| - `sushdns-v3.1.0-android-arm64.tar.gz`: Android (best-effort) | ||
| ### Quick Start | ||
| ```bash | ||
| # Server | ||
| ./sush_daemon run --mode socks5 --bind 0.0.0.0:8080 --secret YOUR_SECRET | ||
| # Client (v3.1 with compression + direct mode) | ||
| ./sush_daemon run --mode socks5 --server-ip SERVER:53 --secret YOUR_SECRET \ | ||
| --transport dns --compress --dns-direct --dns-direct-server YOUR_VPS:53 | ||
| ``` | ||
| See `DNS_DEPLOY.md` for authoritative DNS server setup. | ||
| files: | | ||
| artifacts/linux-x86_64/* | ||
| artifacts/linux-arm64/* | ||
| artifacts/windows-x86_64/* | ||
| artifacts/macos-x86_64/* | ||
| artifacts/macos-arm64/* | ||
| artifacts/android-arm64/* | ||
| draft: false | ||
| prerelease: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||