mit-commit 3.0.1

For building commit linters. This makes it eas.
Documentation
name: Test
on:
  push:
    branches:
      - "*"
  pull_request:
  workflow_dispatch:

jobs:
  lint-markdown:
    uses: PurpleBooth/common-pipelines/.github/workflows/markdown-check.yml@main
  commit-checks:
    uses: PurpleBooth/common-pipelines/.github/workflows/commit-check.yml@main
  rust-checks:
    uses: PurpleBooth/common-pipelines/.github/workflows/rust-check.yml@main

  release:
    if: github.ref == 'refs/heads/main'
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      GITHUB_USER: ${{ github.actor }}
    needs:
      - lint-markdown
      - commit-checks
      - rust-checks
    outputs:
      version_bump: ${{ steps.version_bump.outputs.version_bump }}
      current_version: ${{ steps.current_version.outputs.current_version }}
      previous_version: ${{ steps.previous_version.outputs.previous_version }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.4.0
        with:
          fetch-depth: 0
      - uses: chaaz/versio-actions/install@v1.2
        name: Install versio
      - id: previous_version
        run: echo ::set-output "name=previous_version::$( versio get --id 1 -v )"
      - run: echo ::set-output "name=BUMP::$( versio release --dry-run )"
        id: get_versio_plan
      - name: Generate release
        if: ${{ contains(steps.get_versio_plan.outputs.BUMP, ' -> ') }}
        run: |
          versio release
      - run: echo ::set-output "name=current_version::$( versio get --id 1 -v )"
        id: current_version
      - run: echo ::set-output "name=version_bump::true"
        if: steps.current_version.outputs.current_version != steps.previous_version.outputs.previous_version
        id: version_bump

  publish-to-cargo:
    if: needs.release.outputs.version_bump
    needs:
      - release
    uses: PurpleBooth/common-pipelines/.github/workflows/release-rust-library.yml@main
    with:
      current_version: ${{ needs.release.outputs.current_version }}
      previous_version: ${{ needs.release.outputs.previous_version }}
    secrets:
      cargo_token: ${{ secrets.CARGO_TOKEN }}