name: release
on:
release:
types: [published]
jobs:
release:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Build
run: cargo build --verbose --all-targets
- name: Clippy check
run: cargo clippy --all-targets
- name: Run tests
run: cargo test --verbose
- name: Run rustfmt
run: cargo fmt -- --check
- name: Generate doc
run: |
cargo doc --all --no-deps
echo '<meta http-equiv=refresh content=0;url=uhlc/index.html>' > ./target/doc/index.html
- name: Publish to crates.io
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
cargo publish
- name: Deploy doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc