name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  release:
    name: Create release
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Build for release
        run: nix build --print-out-paths --print-build-logs .#dist

      - name: Release
        uses: https://gitea.com/actions/release-action@main
        with:
          files: |-
            result/hakurei-**
          api_key: '${{secrets.RELEASE_TOKEN}}'
