name: Zen Twilight Scheduled Releases

on:
  schedule:
    - cron: "0 23 */2 * *"
  workflow_dispatch:
    inputs:
      create_release:
        description: "Whether to do a release"
        required: false
        type: boolean
        default: true

jobs:
  twilight-release-schedule:
    name: Twilight Release Schedule
    permissions: write-all
    secrets: inherit
    uses: ./.github/workflows/build.yml
    with:
      create_release: ${{ github.event_name != 'workflow_dispatch' && true || inputs.create_release }}
      update_branch: twilight
      use-sccache: true
      update_version: false

  post-build:
    name: Post Build
    runs-on: ubuntu-latest
    needs: twilight-release-schedule
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: ".nvmrc"
