Skip to content

Commit

Permalink
Add several features to select the TLS dependency for reqwest
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Aug 31, 2024
1 parent af9a0b2 commit 1e46c27
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 6 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ jobs:
target: x86_64-unknown-linux-musl
bin: ubi
name: ubi-Linux-x86_64-musl.tar.gz
- os_name: Linux-x86_64 (rustls-native-roots)
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: ubi
name: ubi-Linux-x86_64-musl.tar.gz
features: rustls-native-roots
- os_name: Linux-x86_64 (native-tls)
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: ubi
name: ubi-Linux-x86_64-musl.tar.gz
features: native-tls
- os_name: Linux-x86_64 (native-tls-vendored)
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: ubi
name: ubi-Linux-x86_64-musl.tar.gz
features: native-tls-vendored
- os_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
Expand Down Expand Up @@ -130,7 +148,10 @@ jobs:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--locked --release"
args: |
--locked \
--release \
${{ matrix.features != '' && format('--features {0}', matrix.features) }}
strip: true
- name: Run tests
uses: houseabsolute/actions-rust-cross@v0
Expand Down
200 changes: 200 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,15 @@ anyhow = "1.0.86"
binstall-tar = "0.4.42"
bzip2 = "0.4.4"
clap = { version = "4.5.9", features = ["wrap_help"] }
document-features = "0.2"
fern = { version = "0.6.2", features = ["colored"] }
flate2 = "1.0.30"
itertools = "0.13.0"
lazy-regex = "3.1.0"
log = "0.4.22"
platforms = "=3.2.0"
regex = "1.10.5"
reqwest = { version = "0.12.5", default-features = false, features = [
"gzip",
"json",
"rustls-tls",
] }
reqwest = { version = "0.12.5", default-features = false, features = ["gzip", "json"] }
result = "1.0.0"
serde = { version = "1.0.204", features = ["derive"] }
strum = { version = "0.26.3", features = ["derive"] }
Expand All @@ -54,6 +51,17 @@ zip = { version = "2.1.5", default-features = false, features = [
"zstd",
] }

[features]
default = ["rustls-tls"]
## enables the `rustls-tls` feature for the `reqwest` crate.
rustls-tls = ["reqwest/rustls-tls"]
## enables the `rustls-tls-native-roots` feature for the `reqwest` crate.
rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"]
## enables the `native-tls` feature for the `reqwest` crate.
native-tls = ["reqwest/native-tls"]
## enables the `native-tls-vendored` feature for the `reqwest` crate.
native-tls-vendored = ["reqwest/native-tls-vendored"]

[workspace.metadata.release]
allow-branch = ["master"]

Expand Down
Loading

0 comments on commit 1e46c27

Please sign in to comment.