[ie/soundcloud] Various fixes (#11820)
[yt-dlp.git] / .github / workflows / release-nightly.yml
blob8f728440584169b9a63c1a7c98d707c76ed3545d
1 name: Release (nightly)
2 on:
3   schedule:
4     - cron: '23 23 * * *'
5 permissions:
6   contents: read
8 jobs:
9   check_nightly:
10     if: vars.BUILD_NIGHTLY != ''
11     runs-on: ubuntu-latest
12     outputs:
13       commit: ${{ steps.check_for_new_commits.outputs.commit }}
14     steps:
15       - uses: actions/checkout@v4
16         with:
17           fetch-depth: 0
18       - name: Check for new commits
19         id: check_for_new_commits
20         run: |
21           relevant_files=(
22             "yt_dlp/*.py"
23             ':!yt_dlp/version.py'
24             "bundle/*.py"
25             "pyproject.toml"
26             "Makefile"
27             ".github/workflows/build.yml"
28           )
29           echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"
31   release:
32     needs: [check_nightly]
33     if: ${{ needs.check_nightly.outputs.commit }}
34     uses: ./.github/workflows/release.yml
35     with:
36       prerelease: true
37       source: nightly
38     permissions:
39       contents: write
40       packages: write  # For package cache
41       actions: write  # For cleaning up cache
42       id-token: write  # mandatory for trusted publishing
43     secrets: inherit
45   publish_pypi:
46     needs: [release]
47     if: vars.NIGHTLY_PYPI_PROJECT != ''
48     runs-on: ubuntu-latest
49     permissions:
50       id-token: write  # mandatory for trusted publishing
51     steps:
52       - name: Download artifacts
53         uses: actions/download-artifact@v4
54         with:
55           path: dist
56           name: build-pypi
57       - name: Publish to PyPI
58         uses: pypa/gh-action-pypi-publish@release/v1
59         with:
60           verbose: true