summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release-nightly.yml
blob: f459a3a17e542758d08ce334f85ecf0b173e0d4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Release (nightly)
on:
  schedule:
    - cron: '23 23 * * *'
permissions:
  contents: read

jobs:
  check_nightly:
    if: vars.BUILD_NIGHTLY != ''
    runs-on: ubuntu-latest
    outputs:
      commit: ${{ steps.check_for_new_commits.outputs.commit }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Check for new commits
        id: check_for_new_commits
        run: |
          relevant_files=(
            "yt_dlp/*.py"
            ':!yt_dlp/version.py'
            "bundle/*.py"
            "pyproject.toml"
            "Makefile"
            ".github/workflows/build.yml"
          )
          echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"

  release:
    needs: [check_nightly]
    if: ${{ needs.check_nightly.outputs.commit }}
    uses: ./.github/workflows/release.yml
    with:
      prerelease: true
      source: nightly
    permissions:
      contents: write
      packages: write
      id-token: write  # mandatory for trusted publishing
    secrets: inherit