Skip to content

Commit 3016ec7

Browse files
authored
ci: deploy docs (#641)
* ci: deploy docs * docs: logo * fix: logo
1 parent 3a89fd1 commit 3016ec7

File tree

18 files changed

+298
-0
lines changed

18 files changed

+298
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- ci/deploy-docs
7+
- master
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
RUST_BACKTRACE: 1
16+
17+
jobs:
18+
build-docs:
19+
strategy:
20+
matrix:
21+
include:
22+
- os: ubuntu-latest
23+
target: x86_64-unknown-linux-gnu
24+
artifact-name: docs-linux
25+
- os: windows-latest
26+
target: x86_64-pc-windows-msvc
27+
artifact-name: docs-windows
28+
- os: macos-latest
29+
target: aarch64-apple-darwin
30+
artifact-name: docs-darwin
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup Rust Toolchain
36+
run: |
37+
rustup toolchain install nightly
38+
rustup default nightly
39+
rustup target add ${{ matrix.target }}
40+
41+
- name: Build Documentation for ${{ matrix.target }}
42+
shell: bash
43+
run: |
44+
GIT_SHA=$(git rev-parse --short HEAD)
45+
export RUSTDOCFLAGS="-Zunstable-options --enable-index-page --cfg docsrs --crate-version $GIT_SHA"
46+
cargo doc --workspace --no-deps --all-features --target ${{ matrix.target }}
47+
48+
- name: Prepare documentation artifact
49+
shell: bash
50+
run: |
51+
mkdir -p docs-output/${{ matrix.target }}
52+
cp -r target/${{ matrix.target }}/doc/* docs-output/${{ matrix.target }}/
53+
54+
- name: Upload documentation artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ matrix.artifact-name }}
58+
path: docs-output/${{ matrix.target }}
59+
retention-days: 1
60+
61+
deploy:
62+
needs: build-docs
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: read
66+
deployments: write
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Download Linux docs
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: docs-linux
74+
path: public/x86_64-unknown-linux-gnu
75+
76+
- name: Download Windows docs
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: docs-windows
80+
path: public/x86_64-pc-windows-msvc
81+
82+
- name: Download Darwin docs
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: docs-darwin
86+
path: public/aarch64-apple-darwin
87+
88+
- name: Copy index page
89+
run: |
90+
cp docs/index.html public/index.html
91+
92+
- name: Deploy to Cloudflare Pages
93+
uses: cloudflare/wrangler-action@v3
94+
with:
95+
apiToken: ${{ secrets.CF_API_TOKEN }}
96+
accountId: ${{ secrets.CF_ACCOUNT_ID }}
97+
command: deploy --assets public --name compio-docs --compatibility-date 2026-01-23

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ We adhere to [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-c
3131
```rust
3232
#![warn(missing_docs)]
3333
#![deny(rustdoc::broken_intra_doc_links)]
34+
#![doc(html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg")]
35+
#![doc(html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg")]
3436
```
3537

3638
[`rustfmt.toml`]: https://github.com/compio-rs/compio/blob/master/rustfmt.toml

compio-buf/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#![cfg_attr(feature = "try_trait_v2", feature(try_trait_v2, try_trait_v2_residual))]
1111
#![warn(missing_docs)]
1212
#![deny(rustdoc::broken_intra_doc_links)]
13+
#![doc(
14+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
15+
)]
16+
#![doc(
17+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
18+
)]
1319

1420
#[cfg(feature = "arrayvec")]
1521
pub use arrayvec;

compio-dispatcher/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
33
#![warn(missing_docs)]
44
#![deny(rustdoc::broken_intra_doc_links)]
5+
#![doc(
6+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
7+
)]
8+
#![doc(
9+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
10+
)]
511

612
use std::{
713
collections::HashSet,

compio-driver/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
77
#![warn(missing_docs)]
88
#![deny(rustdoc::broken_intra_doc_links)]
9+
#![doc(
10+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
11+
)]
12+
#![doc(
13+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
14+
)]
915

1016
use std::{
1117
io,

compio-fs/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
#![cfg_attr(docsrs, feature(doc_cfg))]
44
#![warn(missing_docs)]
55
#![deny(rustdoc::broken_intra_doc_links)]
6+
#![doc(
7+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
8+
)]
9+
#![doc(
10+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
11+
)]
612
#![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))]
713
#![cfg_attr(
814
all(windows, feature = "windows_by_handle"),

compio-io/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
108108
#![warn(missing_docs)]
109109
#![deny(rustdoc::broken_intra_doc_links)]
110+
#![doc(
111+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
112+
)]
113+
#![doc(
114+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
115+
)]
110116
// This is OK as we're thread-per-core and don't need `Send` or other auto trait on anonymous future
111117
#![allow(async_fn_in_trait)]
112118
#![cfg_attr(feature = "allocator_api", feature(allocator_api))]

compio-log/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#![doc(
2+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
3+
)]
4+
#![doc(
5+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
6+
)]
7+
18
#[cfg_attr(not(feature = "enable_log"), doc(hidden))]
29
pub use tracing::*;
310

compio-macros/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#![doc(
2+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
3+
)]
4+
#![doc(
5+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
6+
)]
7+
18
mod item_fn;
29

310
mod main_fn;

compio-net/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
77
#![warn(missing_docs)]
88
#![deny(rustdoc::broken_intra_doc_links)]
9+
#![doc(
10+
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
11+
)]
12+
#![doc(
13+
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
14+
)]
915

1016
mod cmsg;
1117
mod opts;

0 commit comments

Comments
 (0)