From b6ca545e62b90d9519ab568722d259d8f2046a0a Mon Sep 17 00:00:00 2001 From: George Miao Date: Fri, 23 Jan 2026 13:11:03 -0500 Subject: [PATCH 1/3] ci: deploy docs --- .github/workflows/cd_deploy_docs.yml | 95 ++++++++++++++++++++++++ docs/index.html | 105 +++++++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 .github/workflows/cd_deploy_docs.yml create mode 100644 docs/index.html diff --git a/.github/workflows/cd_deploy_docs.yml b/.github/workflows/cd_deploy_docs.yml new file mode 100644 index 00000000..44ce0ca4 --- /dev/null +++ b/.github/workflows/cd_deploy_docs.yml @@ -0,0 +1,95 @@ +name: Deploy Documentation + +on: + push: + branches: + - ci/deploy-docs + - master + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs" + +jobs: + build-docs: + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + artifact-name: docs-linux + - os: windows-latest + target: x86_64-pc-windows-gnu + artifact-name: docs-windows + - os: macos-latest + target: aarch64-apple-darwin + artifact-name: docs-darwin + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust Toolchain + run: | + rustup toolchain install nightly + rustup default nightly + rustup target add ${{ matrix.target }} + + - name: Build Documentation for ${{ matrix.target }} + run: | + cargo doc --workspace --no-deps --all-features --target ${{ matrix.target }} + + - name: Prepare documentation artifact + shell: bash + run: | + mkdir -p docs-output/${{ matrix.target }} + cp -r target/${{ matrix.target }}/doc/* docs-output/${{ matrix.target }}/ + + - name: Upload documentation artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact-name }} + path: docs-output/${{ matrix.target }} + retention-days: 1 + + deploy: + needs: build-docs + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + + - name: Download Linux docs + uses: actions/download-artifact@v4 + with: + name: docs-linux + path: public/x86_64-unknown-linux-gnu + + - name: Download Windows docs + uses: actions/download-artifact@v4 + with: + name: docs-windows + path: public/x86_64-pc-windows-gnu + + - name: Download Darwin docs + uses: actions/download-artifact@v4 + with: + name: docs-darwin + path: public/aarch64-apple-darwin + + - name: Copy index page + run: | + cp docs/index.html public/index.html + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + command: deploy --assets public --name compio-docs --compatibility-date 2026-01-23 diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..6b3f2da4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,105 @@ + + + + + + Compio Documentation + + + +
+ + Compio Logo + +
+
+ Warning: This documentation is built from the master branch and may differ from the + APIs of released versions. To view documentation for released versions, please visit + docs.rs. +
+

Select a platform to view the documentation:

+ + + From f461db507773b563246936b400962f65084e718e Mon Sep 17 00:00:00 2001 From: George Miao Date: Fri, 23 Jan 2026 13:47:07 -0500 Subject: [PATCH 2/3] docs: logo --- .github/workflows/cd_deploy_docs.yml | 8 +++++--- CONTRIBUTING.md | 2 ++ compio-buf/src/lib.rs | 6 ++++++ compio-dispatcher/src/lib.rs | 6 ++++++ compio-driver/src/lib.rs | 6 ++++++ compio-fs/src/lib.rs | 6 ++++++ compio-io/src/lib.rs | 6 ++++++ compio-log/src/lib.rs | 7 +++++++ compio-macros/src/lib.rs | 7 +++++++ compio-net/src/lib.rs | 6 ++++++ compio-process/src/lib.rs | 6 ++++++ compio-quic/src/lib.rs | 6 ++++++ compio-runtime/src/lib.rs | 6 ++++++ compio-signal/src/lib.rs | 6 ++++++ compio-tls/src/lib.rs | 6 ++++++ compio-ws/src/lib.rs | 6 ++++++ compio/src/lib.rs | 6 ++++++ docs/index.html | 6 +++--- 18 files changed, 102 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd_deploy_docs.yml b/.github/workflows/cd_deploy_docs.yml index 44ce0ca4..cdb10a39 100644 --- a/.github/workflows/cd_deploy_docs.yml +++ b/.github/workflows/cd_deploy_docs.yml @@ -13,7 +13,6 @@ concurrency: env: RUST_BACKTRACE: 1 - RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs" jobs: build-docs: @@ -24,7 +23,7 @@ jobs: target: x86_64-unknown-linux-gnu artifact-name: docs-linux - os: windows-latest - target: x86_64-pc-windows-gnu + target: x86_64-pc-windows-msvc artifact-name: docs-windows - os: macos-latest target: aarch64-apple-darwin @@ -40,7 +39,10 @@ jobs: rustup target add ${{ matrix.target }} - name: Build Documentation for ${{ matrix.target }} + shell: bash run: | + GIT_SHA=$(git rev-parse --short HEAD) + export RUSTDOCFLAGS="-Zunstable-options --enable-index-page --cfg docsrs --crate-version $GIT_SHA" cargo doc --workspace --no-deps --all-features --target ${{ matrix.target }} - name: Prepare documentation artifact @@ -75,7 +77,7 @@ jobs: uses: actions/download-artifact@v4 with: name: docs-windows - path: public/x86_64-pc-windows-gnu + path: public/x86_64-pc-windows-msvc - name: Download Darwin docs uses: actions/download-artifact@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd2dc9c5..4a4f8e18 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,8 @@ We adhere to [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-c ```rust #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] + #![doc(html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg")] + #![doc(html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg")] ``` [`rustfmt.toml`]: https://github.com/compio-rs/compio/blob/master/rustfmt.toml diff --git a/compio-buf/src/lib.rs b/compio-buf/src/lib.rs index 50ae1c84..d4e11fa7 100644 --- a/compio-buf/src/lib.rs +++ b/compio-buf/src/lib.rs @@ -10,6 +10,12 @@ #![cfg_attr(feature = "try_trait_v2", feature(try_trait_v2, try_trait_v2_residual))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] #[cfg(feature = "arrayvec")] pub use arrayvec; diff --git a/compio-dispatcher/src/lib.rs b/compio-dispatcher/src/lib.rs index 5c1eb7fe..b24c91e0 100644 --- a/compio-dispatcher/src/lib.rs +++ b/compio-dispatcher/src/lib.rs @@ -2,6 +2,12 @@ #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] use std::{ collections::HashSet, diff --git a/compio-driver/src/lib.rs b/compio-driver/src/lib.rs index efd6a6a2..22d6e5a8 100644 --- a/compio-driver/src/lib.rs +++ b/compio-driver/src/lib.rs @@ -6,6 +6,12 @@ #![cfg_attr(feature = "once_cell_try", feature(once_cell_try))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] use std::{ io, diff --git a/compio-fs/src/lib.rs b/compio-fs/src/lib.rs index 38be7f94..5ae871a9 100644 --- a/compio-fs/src/lib.rs +++ b/compio-fs/src/lib.rs @@ -3,6 +3,12 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] #![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))] #![cfg_attr( all(windows, feature = "windows_by_handle"), diff --git a/compio-io/src/lib.rs b/compio-io/src/lib.rs index 7d82315c..dfff564d 100644 --- a/compio-io/src/lib.rs +++ b/compio-io/src/lib.rs @@ -107,6 +107,12 @@ #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] // This is OK as we're thread-per-core and don't need `Send` or other auto trait on anonymous future #![allow(async_fn_in_trait)] #![cfg_attr(feature = "allocator_api", feature(allocator_api))] diff --git a/compio-log/src/lib.rs b/compio-log/src/lib.rs index f0bdd072..97c8492e 100644 --- a/compio-log/src/lib.rs +++ b/compio-log/src/lib.rs @@ -1,3 +1,10 @@ +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] + #[cfg_attr(not(feature = "enable_log"), doc(hidden))] pub use tracing::*; diff --git a/compio-macros/src/lib.rs b/compio-macros/src/lib.rs index 4f5ac529..ae7db9a8 100644 --- a/compio-macros/src/lib.rs +++ b/compio-macros/src/lib.rs @@ -1,3 +1,10 @@ +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] + mod item_fn; mod main_fn; diff --git a/compio-net/src/lib.rs b/compio-net/src/lib.rs index 931b6a3d..dd283bed 100644 --- a/compio-net/src/lib.rs +++ b/compio-net/src/lib.rs @@ -6,6 +6,12 @@ #![cfg_attr(feature = "once_cell_try", feature(once_cell_try))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] mod cmsg; mod opts; diff --git a/compio-process/src/lib.rs b/compio-process/src/lib.rs index faceda67..60253819 100644 --- a/compio-process/src/lib.rs +++ b/compio-process/src/lib.rs @@ -7,6 +7,12 @@ )] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] cfg_if::cfg_if! { if #[cfg(windows)] { diff --git a/compio-quic/src/lib.rs b/compio-quic/src/lib.rs index 0769a3c5..84a99034 100644 --- a/compio-quic/src/lib.rs +++ b/compio-quic/src/lib.rs @@ -5,6 +5,12 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] pub use quinn_proto::{ AckFrequencyConfig, ApplicationClose, Chunk, ClientConfig, ClosedStream, ConfigError, diff --git a/compio-runtime/src/lib.rs b/compio-runtime/src/lib.rs index 70391174..69d14454 100644 --- a/compio-runtime/src/lib.rs +++ b/compio-runtime/src/lib.rs @@ -13,6 +13,12 @@ #![cfg_attr(feature = "future-combinator", feature(context_ext, local_waker))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] mod affinity; mod attacher; diff --git a/compio-signal/src/lib.rs b/compio-signal/src/lib.rs index 7cf0bcbd..4642cf92 100644 --- a/compio-signal/src/lib.rs +++ b/compio-signal/src/lib.rs @@ -19,6 +19,12 @@ #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] #![allow(stable_features)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] #[cfg(windows)] pub mod windows; diff --git a/compio-tls/src/lib.rs b/compio-tls/src/lib.rs index 36454959..ea6624f3 100644 --- a/compio-tls/src/lib.rs +++ b/compio-tls/src/lib.rs @@ -2,6 +2,12 @@ #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] #![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))] #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/compio-ws/src/lib.rs b/compio-ws/src/lib.rs index 14ca6042..f073b501 100644 --- a/compio-ws/src/lib.rs +++ b/compio-ws/src/lib.rs @@ -12,6 +12,12 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] use std::io::ErrorKind; diff --git a/compio/src/lib.rs b/compio/src/lib.rs index e261db04..662a0e1d 100644 --- a/compio/src/lib.rs +++ b/compio/src/lib.rs @@ -22,6 +22,12 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![warn(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] +#![doc( + html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] +#![doc( + html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg" +)] #[doc(no_inline)] pub use buf::BufResult; diff --git a/docs/index.html b/docs/index.html index 6b3f2da4..e4270bca 100644 --- a/docs/index.html +++ b/docs/index.html @@ -78,7 +78,7 @@
Warning: This documentation is built from the master branch and may differ from the APIs of released versions. To view documentation for released versions, please visit - docs.rs. + docs.rs.

Select a platform to view the documentation: