4 Commits

6 changed files with 90 additions and 90 deletions

View File

@@ -70,3 +70,8 @@ jobs:
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo test $FLAGS -- --nocapture" echo "Running: cargo test $FLAGS -- --nocapture"
cargo test $FLAGS -- --nocapture cargo test $FLAGS -- --nocapture
- name: Build Docs
shell: bash
run: |
cargo doc -p hyper-custom-cert --no-deps

View File

@@ -1,76 +0,0 @@
name: Documentation
on:
push:
tags:
- 'v*'
jobs:
docs:
name: Build and validate documentation
runs-on: ubuntu-latest
defaults:
run:
working-directory: crates/hyper-custom-cert
strategy:
fail-fast: false
matrix:
include:
- name: default-features
features: ""
no-default-features: false
- name: no-default-features
features: ""
no-default-features: true
- name: rustls
features: "rustls"
no-default-features: true
- name: insecure-dangerous
features: "insecure-dangerous"
no-default-features: false
- name: all-features
features: "rustls,insecure-dangerous"
no-default-features: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust
run: rustup update stable && rustup default stable
- name: Build documentation
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
cargo doc $FLAGS --no-deps
- name: Check documentation warnings
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
RUSTDOCFLAGS="-D warnings" cargo doc $FLAGS --no-deps
- name: Test documentation examples
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo test --doc $FLAGS"
cargo test --doc $FLAGS

View File

@@ -9,9 +9,79 @@ env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
docs:
name: Build and validate documentation
runs-on: ubuntu-latest
defaults:
run:
working-directory: crates/hyper-custom-cert
strategy:
fail-fast: false
matrix:
include:
- name: default-features
features: ""
no-default-features: false
- name: no-default-features
features: ""
no-default-features: true
- name: rustls
features: "rustls"
no-default-features: true
- name: insecure-dangerous
features: "insecure-dangerous"
no-default-features: false
- name: all-features
features: "rustls,insecure-dangerous"
no-default-features: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust
run: rustup update stable && rustup default stable
- name: Build documentation
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
cargo doc $FLAGS --no-deps
- name: Check documentation warnings
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
RUSTDOCFLAGS="-D warnings" cargo doc $FLAGS --no-deps
- name: Test documentation examples
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo test --doc $FLAGS"
cargo test --doc $FLAGS
test: test:
name: Test before release name: Test before release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: docs
defaults: defaults:
run: run:
working-directory: crates/hyper-custom-cert working-directory: crates/hyper-custom-cert
@@ -75,9 +145,12 @@ jobs:
echo "Running: cargo test $FLAGS -- --nocapture" echo "Running: cargo test $FLAGS -- --nocapture"
cargo test $FLAGS -- --nocapture cargo test $FLAGS -- --nocapture
publish: publish:
name: Publish to crates.io name: Publish to crates.io
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC token exchange https://crates.io/docs/trusted-publishing
needs: test needs: test
defaults: defaults:
run: run:
@@ -108,10 +181,13 @@ jobs:
exit 1 exit 1
fi fi
- name: Publish to crates.io # See Trusted publishing: https://crates.io/docs/trusted-publishing
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish
env: env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish
release: release:
name: Create GitHub Release name: Create GitHub Release

2
Cargo.lock generated
View File

@@ -364,7 +364,7 @@ dependencies = [
[[package]] [[package]]
name = "hyper-custom-cert" name = "hyper-custom-cert"
version = "0.1.6" version = "0.3.0"
dependencies = [ dependencies = [
"hyper-rustls", "hyper-rustls",
"hyper-tls", "hyper-tls",

View File

@@ -17,12 +17,7 @@ A small, ergonomic HTTP client wrapper around hyper with optional support for cu
## Quick Start ## Quick Start
Add this to your `Cargo.toml`: `cargo add hyper-custom-cert`
```toml
[dependencies]
hyper-custom-cert = "0.1.0"
```
### Basic Usage (Secure Default) ### Basic Usage (Secure Default)

View File

@@ -1,13 +1,13 @@
[package] [package]
name = "hyper-custom-cert" name = "hyper-custom-cert"
version = "0.1.8" version = "0.3.0"
edition = "2021" edition = "2024"
description = "A small, ergonomic HTTP client wrapper around hyper with optional support for custom Root CAs and a dev-only insecure mode for self-signed certificates." description = "A small, ergonomic HTTP client wrapper around hyper with optional support for custom Root CAs and a dev-only insecure mode for self-signed certificates."
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://github.com/seemueller-io/hyper-custom-cert" repository = "https://github.com/seemueller-io/hyper-custom-cert"
documentation = "https://docs.rs/hyper-custom-cert" documentation = "https://docs.rs/hyper-custom-cert"
homepage = "https://docs.rs/hyper-custom-cert" homepage = "https://docs.rs/hyper-custom-cert"
readme = "README.md" readme = "../../README.md"
keywords = ["hyper", "http-client", "tls", "rustls", "self-signed"] keywords = ["hyper", "http-client", "tls", "rustls", "self-signed"]
categories = ["asynchronous", "network-programming", "web-programming::http-client"] categories = ["asynchronous", "network-programming", "web-programming::http-client"]
@@ -38,5 +38,5 @@ rustls = ["dep:hyper-rustls", "dep:rustls-pemfile"]
insecure-dangerous = [] insecure-dangerous = []
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = false all-features = true
no-default-features = false no-default-features = false