name: Upload dist/

on:
  release:
    types: [created]

jobs:
  upload-dist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm install
      - run: npm run build
      - run: zip -r $GITHUB_REF_NAME-dist.zip dist/
      - run: gh release upload $GITHUB_REF_NAME $GITHUB_REF_NAME-dist.zip
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}