release-nightly.yml 1.6 KB

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