Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lxl66566 committed May 31, 2024
1 parent 4290fb0 commit 1c10654
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
- os: macos-latest
target: aarch64-apple-darwin
compress: true
- os: ubuntu-latest
target: x86_64-unknown-freebsd
compress: true
# - os: ubuntu-latest
# target: x86_64-unknown-freebsd
# compress: true

# The type of runner that the job will run on
# Runs on Ubuntu if other os is not specified above
Expand Down Expand Up @@ -77,16 +77,16 @@ jobs:

- name: Install openssl on ubuntu if needed
if: startsWith(matrix.os, 'ubuntu')
run: grep -q 'openssl' 'Cargo.lock' && sudo apt install pkg-config libssl-dev
run: grep -q 'openssl' 'Cargo.lock' && sudo apt install pkg-config libssl-dev || true
- name: Install openssl on macos if needed
if: startsWith(matrix.os, 'macos')
run: grep -q 'openssl' 'Cargo.lock' && brew install openssl
- name: Set Perl environment variables
if: runner.os == 'Windows'
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
# choco install openssl strawberryperl
run: grep -q 'openssl' 'Cargo.lock' && brew install openssl || true
# - name: Set Perl environment variables
# if: runner.os == 'Windows'
# run: |
# # choco install openssl strawberryperl
# echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
# echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8

- name: Build and Upload
uses: taiki-e/upload-rust-binary-action@v1
Expand Down
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ tokio = { version = "1.38.0", features = ["rt", "macros", "rt-multi-thread"] }
futures-util = "0.3.30"
netdev = "0.27.0"
log = "0.4.21"
tap = "1.0.1"
# openssl = { version = "0.10.64", features = ["vendored"] }

clap = { version = "4.5.4", features = ["derive"], optional = true }
colored = { version = "2.1.0", optional = true }
env_logger = { version = "*", optional = true }
tap = "1.0.1"

[dependencies.reqwest]
version = "0.12.4"
features = ["blocking", "rustls-tls"]
default-features = false

[profile.release]
strip = true
lto = true
panic = "abort"
opt-level = "z"

[features]
build-binary = ["clap", "colored", "env_logger"]

Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ use colored::Colorize;
pub struct Cli {
#[command(subcommand)]
pub subcommand: Subcommand,
/// WIP: source to generate ip rules
#[arg(short, long)]
source: Option<String>,
}

#[derive(Debug, clap::Subcommand, Clone)]
pub enum Subcommand {
/// Export up and down scripts for windows, mac, linux, android, openvpn
Export(ExportArgs),
/// Write IP rules to system route table
Up,
/// Remove IP rules from system route table
Down,
}

#[derive(Debug, clap::Args, Clone)]
pub struct ExportArgs {
/// The platform of script you want to export
#[arg(short, long)]
platform: Option<String>,
}
Expand Down

0 comments on commit 1c10654

Please sign in to comment.