ctlog 0.1.0

A simple certificate transparency log client API wrapper
Documentation
on:
  push:
    branches:
      - main
    tags:
      - v*
  pull_request:
    branches:
      - main
  workflow_dispatch:

name: Rust CI

jobs:
  build-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Check fmt
        run: cargo fmt --all --check
      - name: Check clippy
        run: cargo clippy -- -D warnings
      - name: Check build
        run: cargo build
      - name: Check test
        run: cargo test

  changelog-check:
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: Zomzog/changelog-checker@v1.3.0
        with:
          fileName: CHANGELOG.md
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  release:
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
    needs: [build-check]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Publish to crates.io
        uses: katyo/publish-crates@v1
        with:
          path: .
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}