name: release

on:
  workflow_dispatch:

permissions:
  contents: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
      - name: Create release
        run: |
          export TZ=Asia/Shanghai
          TAG="v$(deno run -q version).$(date +%y%m%d%H%M)"
          gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
        env:
          GH_TOKEN: ${{ github.token }}
