ubits 0.3.1

Bit fields and masks.
Documentation
name: Rust

on:
  push:
    paths-ignore:
      - 'docs/**'
      - 'README.md'
    branches: [ main ]
  pull_request:
    paths-ignore:
      - 'docs/**'
      - 'README.md'
    branches: [ main ]

env:
  CARGO_TERM_COLOR: always

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install latest
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy
      - name: Lint
        run: cargo fmt --check --verbose

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install latest
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy
      - name: Build
        run: cargo build --verbose
      - name: Test
        run: cargo test --verbose --all

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install latest
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy
      - run: rustup component add clippy
      - uses: actions-rs/clippy-check@v1
        with:
          toolchain: stable
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features -- -D warnings

  docs:
    runs-on: ubuntu-latest
    if: github.ref != 'refs/heads/main'
    steps:
      - uses: actions/checkout@v3
        with:
          ref: refs/heads/${{ github.head_ref }}
          persist-credentials: false
          fetch-depth: 0
      - name: Install latest
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy
      - name: Install cargo-readme
        run: cargo install cargo-readme
      - name: Build Docs
        run: sh scripts/build-docs.sh
      - name: Generate Readme
        run: cargo readme > README.md
      - name: Commit Docs
        run: |
          git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add -A
          git commit -am "[Automated] Doc Build"
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.head_ref }}

  dry_release:
    runs-on: ubuntu-latest
    if: github.ref != 'refs/heads/main'
    needs:
      - format
      - test
      - clippy
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
            toolchain: stable
            override: true
      - uses: manoadamro/rust-release@v1
        with:
          owner: ${{ github.repository_owner }}
          repo: ${{ github.repository }}
          token: ${{ secrets.GITHUB_TOKEN }}
          dry_run: true
      - uses: katyo/publish-crates@v1
        with:
            registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
            ignore-unpublished-changes: true
            check-repo: false
            dry-run: true
            
  release:
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    needs:
      - format
      - test
      - clippy
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
            toolchain: stable
            override: true
      - uses: manoadamro/rust-release@v1
        with:
          owner: ${{ github.repository_owner }}
          repo: ${{ github.repository }}
          token: ${{ secrets.GITHUB_TOKEN }}
#      - uses: trstringer/manual-approval@v1
#        with:
#          secret: ${{ github.TOKEN }}
#          approvers: manoadamro
#          minimum-approvals: 1
      - uses: katyo/publish-crates@v1
        with:
            registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
            ignore-unpublished-changes: true
            check-repo: true
            dry-run: false