name: release

on:
  push:
    tags:
      - "v*"

jobs:
  release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      # チェックアウト
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      # Go をセットアップ
      - uses: actions/setup-go@v3
        with:
          go-version: "1.21.0"

      # リリース
      - uses: goreleaser/goreleaser-action@v4
        with:
          args: release --clean
          workdir: ./hostr
          version: latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
