name: 'Nightly Releases'

on:
  schedule:
    - cron: '0 0 * * 2-6'

permissions:
  contents: read # to fetch code (actions/checkout)

jobs:
  publish:
    name: 'Publish'
    runs-on: ubuntu-latest
    if: github.repository == 'strapi/strapi'
    steps:
      - uses: actions/checkout@v6
      - name: Setup npmrc
        run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
      - uses: actions/setup-node@v6
        with:
          node-version: 24
      - run: yarn
      - run: ./scripts/pre-publish.sh --yes
        env:
          VERSION: '0.0.0-next.${{ github.sha }}'
          DIST_TAG: next
