name: Create Release on every tag push in `production`

on:
  push:
    branches:
      - production
    tags:
      - '*'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: production
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - run: npm ci && npm run build
      - run: cd dist && zip -r ../phanpy-dist.zip . && cd ..
      - uses: softprops/action-gh-release@v1
        with:
          generate_release_notes: true
          files: phanpy-dist.zip
