name: Release

on: [ workflow_dispatch ]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    - name: cargo plugin cache
      id: cargo-plugin-cache
      uses: actions/cache@v3
      with:
        path: ~/.cargo/bin
        key: ${{ runner.os }}-cargo-plugins
    - name: install cargo plugin
      if: steps.cargo-plugin-cache.outputs.cache-hit != 'true'
      run: cargo install cargo-release
    - name: Release
      env:
        CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
      run: |
        git config --global user.email "ruimo.uno@gmail.com"
        git config --global user.name "Shisei Hanai"
        git tag
        cargo release release -vv --execute --no-confirm
