name: Build and create draft release

on:
  push:
    tags:
    - v*.*.*

jobs:
  release:
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
    - uses: actions/checkout@v6

    - name: Build
      run: scripts/build

    - name: Create or update draft release with ZIP
      uses: softprops/action-gh-release@v3
      with:
        draft: true
        fail_on_unmatched_files: true
        generate_release_notes: true
        files: ./hass-oidc-auth.zip
