bump-bin 0.4.3

Increments version with semver specification
Documentation
name: Release

on:
  workflow_dispatch:
    inputs:
      level:
        description: 'Version Level'
        required: true
        default: 'minor'
        type: choice
        options:
        - major
        - minor
        - patch

env:
  NAME: bump

jobs:
  release:
    name: Publish creates.io and create github release
    runs-on: ubuntu-latest

    outputs:
      tag: ${{ steps.publish.outputs.tag }}

    steps:
    - name: Setup code
      uses: actions/checkout@v3
      # Fetch all histories and tags to create release note
      with: { fetch-depth: 0 }

    - name: Setup release tools
      run: |
        url=$(gh release view -R crate-ci/cargo-release --json assets --jq '.assets[] | select(.name | contains("linux")) | .url')
        curl -fsSL $url -o- | tar xz -C ~/.cargo/bin
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    - name: Publish creates.io(with git tag)
      id: publish
      run: |
        git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
        git config --local user.name "github-actions[bot]"
        cargo release ${{ github.event.inputs.level }} --execute --no-confirm -v
        tag=$(git describe --tags --abbrev=0)
        echo "tag=$tag" >> "$GITHUB_OUTPUT"
      env:
        CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

    - name: Create github release
      run: gh release create ${{ steps.publish.outputs.tag }} --generate-notes
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  assets:
    name: Build and upload
    needs: [release]
    strategy:
      matrix:
        include:
        - target: x86_64-unknown-linux-gnu
          os: ubuntu-latest
        - target: x86_64-apple-darwin
          os: macos-latest
        - target: aarch64-apple-darwin
          os: macos-latest

    runs-on: ${{ matrix.os }}

    steps:
    - name: Setup code
      uses: actions/checkout@v3

    - name: Setup Rust toolchain
      run: |
        rustup set profile minimal
        rustup install stable
        rustup override set stable
        rustup target add ${{ matrix.target }}

    - name: Build
      run: cargo build --release --target=${{ matrix.target }}

    - name: Create artifact
      run: |
        tar -acvf ${{ env.NAME }}-${{ needs.release.outputs.tag }}-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release ${{ env.NAME }}
        set -e
        ls -la ${{ env.NAME }}-${{ needs.release.outputs.tag }}-${{ matrix.target }}.tar.gz

    - name: Upload assets
      run: gh release upload ${{ needs.release.outputs.tag }} ./${{ env.NAME }}-${{ needs.release.outputs.tag }}-${{ matrix.target }}.tar.gz
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}