name: Test Lint Publish
on:
workflow_dispatch:
jobs:
linting_docs_build:
if: ${{ github.ref == 'refs/heads/master' }}
continue-on-error: false
name: Lint and Docs Build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Running Doc Compile
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
creates_publish:
if: ${{ github.ref == 'refs/heads/master' }}
continue-on-error: false
name: Crates Publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Publishing to Crates.io
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}