2023-03-03 12:03:12 -05:00
|
|
|
name: Release (nightly)
|
|
|
|
on:
|
2023-11-12 18:49:15 -05:00
|
|
|
schedule:
|
|
|
|
- cron: '23 23 * * *'
|
2023-03-03 12:03:12 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
2023-11-12 18:49:15 -05:00
|
|
|
check_nightly:
|
2023-03-03 12:03:12 -05:00
|
|
|
if: vars.BUILD_NIGHTLY != ''
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2023-11-12 18:49:15 -05:00
|
|
|
commit: ${{ steps.check_for_new_commits.outputs.commit }}
|
2023-03-03 12:03:12 -05:00
|
|
|
steps:
|
2023-11-12 19:30:01 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-12 18:49:15 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Check for new commits
|
|
|
|
id: check_for_new_commits
|
2023-03-03 12:03:12 -05:00
|
|
|
run: |
|
2024-02-11 11:35:27 -05:00
|
|
|
relevant_files=(
|
|
|
|
"yt_dlp/*.py"
|
|
|
|
':!yt_dlp/version.py'
|
|
|
|
"bundle/*.py"
|
|
|
|
"pyproject.toml"
|
|
|
|
"Makefile"
|
|
|
|
".github/workflows/build.yml"
|
|
|
|
)
|
2023-11-12 18:49:15 -05:00
|
|
|
echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"
|
2023-03-03 12:03:12 -05:00
|
|
|
|
2023-11-12 18:49:15 -05:00
|
|
|
release:
|
|
|
|
needs: [check_nightly]
|
|
|
|
if: ${{ needs.check_nightly.outputs.commit }}
|
|
|
|
uses: ./.github/workflows/release.yml
|
2023-03-03 12:03:12 -05:00
|
|
|
with:
|
2023-11-12 18:49:15 -05:00
|
|
|
prerelease: true
|
|
|
|
source: nightly
|
2023-03-03 12:03:12 -05:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-06-13 17:13:08 -04:00
|
|
|
packages: write # For package cache
|
|
|
|
actions: write # For cleaning up cache
|
2023-11-12 18:49:15 -05:00
|
|
|
id-token: write # mandatory for trusted publishing
|
|
|
|
secrets: inherit
|
2024-11-09 18:26:02 -05:00
|
|
|
|
|
|
|
publish_pypi:
|
|
|
|
needs: [release]
|
|
|
|
if: vars.NIGHTLY_PYPI_PROJECT != ''
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
id-token: write # mandatory for trusted publishing
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
path: dist
|
|
|
|
name: build-pypi
|
|
|
|
- name: Publish to PyPI
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
|
|
|
verbose: true
|