Skip to content

Commit

Permalink
Bump version 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Mar 30, 2024
1 parent 6215090 commit e5d7e49
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then
zip -j mypubdir4/dns2socks-${{ matrix.target }}.zip target/${{ matrix.target }}/release/dns2socks README.md target/dns2socks-ffi.h target/${{ matrix.target }}/release/libdns2socks.dylib
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
./build-aarch64-apple-ios.sh
zip -r mypubdir4/dns2socks-aarch64-apple-ios-xcframework.zip ./dns2socks.xcframework/
./build-apple.sh
zip -r mypubdir4/dns2socks-apple-xcframework.zip ./dns2socks.xcframework/
fi
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dns2socks"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
license = "MIT"
repository = "https://github.com/ssrlive/dns2socks"
Expand All @@ -18,7 +18,7 @@ ctrlc2 = { version = "3.5", features = ["tokio", "termination"] }
dotenvy = "0.15"
env_logger = "0.11"
log = "0.4"
moka = { version = "0.12", features = ["future"] }
moka = { version = "0.12", default-features = false, features = ["future"] }
rand = "0.8"
socks5-impl = "0.5"
tokio = { version = "1.36", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion build-apple-debug.sh → build-aarch64-apple-ios-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Generating includes..."
mkdir -p target/include/
rm -rf target/include/*
cbindgen --config cbindgen.toml -l C -o target/include/dns2socks.h
cat > target/include/module.modulemap <<EOF
cat > target/include/dns2socks.modulemap <<EOF
framework module dns2socks {
umbrella header "dns2socks.h"
Expand Down
27 changes: 27 additions & 0 deletions build-aarch64-apple-ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh

echo "Setting up the rust environment..."
rustup target add aarch64-apple-ios
cargo install cbindgen

echo "Building target aarch64-apple-ios..."
cargo build --release --target aarch64-apple-ios

echo "Generating includes..."
mkdir -p target/include/
rm -rf target/include/*
cbindgen --config cbindgen.toml -l C -o target/include/dns2socks.h
cat > target/include/dns2socks.modulemap <<EOF
framework module dns2socks {
umbrella header "dns2socks.h"
export *
module * { export * }
}
EOF

echo "Creating XCFramework"
rm -rf ./dns2socks.xcframework
xcodebuild -create-xcframework \
-library ./target/aarch64-apple-ios/release/libdns2socks.a -headers ./target/include/ \
-output ./dns2socks.xcframework
13 changes: 12 additions & 1 deletion build-apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios x86_6
cargo install cbindgen

echo "Building..."

echo "cargo build --release --target x86_64-apple-darwin"
cargo build --release --target x86_64-apple-darwin

echo "cargo build --release --target aarch64-apple-darwin"
cargo build --release --target aarch64-apple-darwin

echo "cargo build --release --target aarch64-apple-ios"
cargo build --release --target aarch64-apple-ios

echo "cargo build --release --target x86_64-apple-ios"
cargo build --release --target x86_64-apple-ios

echo "cargo build --release --target aarch64-apple-ios-sim"
cargo build --release --target aarch64-apple-ios-sim

echo "Generating includes..."
mkdir -p target/include/
rm -rf target/include/*
cbindgen --config cbindgen.toml -l C -o target/include/dns2socks.h
cat > target/include/module.modulemap <<EOF
cat > target/include/dns2socks.modulemap <<EOF
framework module dns2socks {
umbrella header "dns2socks.h"
Expand Down
6 changes: 6 additions & 0 deletions cbindgen.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[export]
include = ["dns2socks_start", "dns2socks_stop", "dns2socks_set_log_callback"]
exclude = []

[export.rename]
"ArgVerbosity" = "Dns2socksVerbosity"

[enum]
prefix_with_name = true
1 change: 0 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub unsafe extern "C" fn dns2socks_start(
log::set_max_level(verbosity.into());
if let Err(err) = log::set_boxed_logger(Box::<crate::dump_logger::DumpLogger>::default()) {
log::error!("set logger error: {}", err);
return -1;
}

let mut config = crate::Config::default();
Expand Down

0 comments on commit e5d7e49

Please sign in to comment.