Skip to content

Commit c66b7fa

Browse files
authored
Merge pull request #40 from zjp-CN/master
deploy docs on github pages
2 parents 327c0eb + 0b4d113 commit c66b7fa

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

.github/workflows/doc.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mkdir doc
2+
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_tokio --no-deps
3+
mv target/doc/ doc/use_tokio
4+
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_async-std --no-deps
5+
mv target/doc/ doc/use_async-std

.github/workflows/doc.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Doc
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Install Rust
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
toolchain: nightly
17+
profile: minimal
18+
override: true
19+
20+
- name: Generate docs
21+
run: sh .github/workflows/doc.sh
22+
23+
- name: Deploy
24+
uses: peaceiris/actions-gh-pages@v3
25+
with:
26+
# github_token: ${{ secrets.GITHUB_TOKEN }}
27+
# user_name: 'github-actions[bot]'
28+
# user_email: 'github-actions[bot]@users.noreply.github.com'
29+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
30+
publish_dir: ./doc
31+
force_orphan: true
32+
commit_message: ${{ github.event.head_commit.message }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
**/*.rs.bk
33
Cargo.lock
4+
/doc

src/create/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! E.g. when using the features `use_tokio`, you will need to run all the
1212
//! API functions from inside the tokio runtime.
1313
#[cfg(feature = "use_tokio")]
14-
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
1514
pub mod tokio;
1615

1716
#[cfg(feature = "use_async-std")]

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//!
2323
//! I've not yet worked through the details of what-to-export, but I'm quite
2424
//! willing to consider what people need or want.
25-
#![cfg_attr(docsrs, feature(doc_cfg))]
25+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2626
extern crate rmp;
2727
extern crate rmpv;
2828
#[macro_use]
@@ -48,9 +48,8 @@ pub use crate::{
4848
};
4949

5050
#[cfg(feature = "use_tokio")]
51-
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
5251
pub mod compat {
53-
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
52+
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
5453
pub mod tokio {
5554
pub use tokio_util::compat::Compat;
5655
}

0 commit comments

Comments
 (0)