2023-03-03 10:03:12 -07:00
|
|
|
name: Release (nightly)
|
|
|
|
on:
|
2023-11-12 16:49:15 -07:00
|
|
|
schedule:
|
|
|
|
- cron: '23 23 * * *'
|
2023-03-03 10:03:12 -07:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
2023-11-12 16:49:15 -07:00
|
|
|
check_nightly:
|
2023-03-03 10:03:12 -07:00
|
|
|
if: vars.BUILD_NIGHTLY != ''
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2023-11-12 16:49:15 -07:00
|
|
|
commit: ${{ steps.check_for_new_commits.outputs.commit }}
|
2023-03-03 10:03:12 -07:00
|
|
|
steps:
|
2023-11-12 17:30:01 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-12 16:49:15 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Check for new commits
|
|
|
|
id: check_for_new_commits
|
2023-03-03 10:03:12 -07:00
|
|
|
run: |
|
2024-02-11 09:35:27 -07:00
|
|
|
relevant_files=(
|
|
|
|
"yt_dlp/*.py"
|
|
|
|
':!yt_dlp/version.py'
|
|
|
|
"bundle/*.py"
|
|
|
|
"pyproject.toml"
|
|
|
|
"Makefile"
|
|
|
|
".github/workflows/build.yml"
|
|
|
|
)
|
2023-11-12 16:49:15 -07:00
|
|
|
echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"
|
2023-03-03 10:03:12 -07:00
|
|
|
|
2023-11-12 16:49:15 -07:00
|
|
|
release:
|
|
|
|
needs: [check_nightly]
|
|
|
|
if: ${{ needs.check_nightly.outputs.commit }}
|
|
|
|
uses: ./.github/workflows/release.yml
|
2023-03-03 10:03:12 -07:00
|
|
|
with:
|
2023-11-12 16:49:15 -07:00
|
|
|
prerelease: true
|
|
|
|
source: nightly
|
2023-03-03 10:03:12 -07:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-06-13 15:13:08 -06:00
|
|
|
packages: write # For package cache
|
|
|
|
actions: write # For cleaning up cache
|
2023-11-12 16:49:15 -07:00
|
|
|
id-token: write # mandatory for trusted publishing
|
|
|
|
secrets: inherit
|
2024-11-09 16:26:02 -07: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
|