name: Release
on:
  release:
    types: [published]
permissions:
  contents: write
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22 }
      - run: npm ci && npm run build
      - run: cp dist/houseplan-card.js custom_components/houseplan/frontend/
      - name: Attach card to release
        uses: softprops/action-gh-release@v2
        with:
          files: dist/houseplan-card.js
