Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy docs on github pages #40

Merged
merged 4 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir doc
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_tokio --no-deps
mv target/doc/ doc/use_tokio
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_async-std --no-deps
mv target/doc/ doc/use_async-std
32 changes: 32 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Doc

on:
push:
branches: [ master ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Generate docs
run: sh .github/workflows/doc.sh

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# user_name: 'github-actions[bot]'
# user_email: 'github-actions[bot]@users.noreply.github.com'
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./doc
force_orphan: true
commit_message: ${{ github.event.head_commit.message }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
**/*.rs.bk
Cargo.lock
/doc
1 change: 0 additions & 1 deletion src/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//! E.g. when using the features `use_tokio`, you will need to run all the
//! API functions from inside the tokio runtime.
#[cfg(feature = "use_tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
pub mod tokio;

#[cfg(feature = "use_async-std")]
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//!
//! I've not yet worked through the details of what-to-export, but I'm quite
//! willing to consider what people need or want.
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
extern crate rmp;
extern crate rmpv;
#[macro_use]
Expand All @@ -48,9 +48,8 @@ pub use crate::{
};

#[cfg(feature = "use_tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
pub mod compat {
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
pub mod tokio {
pub use tokio_util::compat::Compat;
}
Expand Down