1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-09 08:21:24 +00:00

[build] Improve nightly release check (#15455)

Authored by: bashonly
This commit is contained in:
bashonly
2026-01-02 10:02:58 -06:00
committed by GitHub
parent 260ba3abba
commit 3763d0d4ab
2 changed files with 36 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ name: Release (nightly)
on:
schedule:
- cron: '23 23 * * *'
workflow_dispatch:
permissions: {}
@@ -19,6 +20,22 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Retrieve HEAD commit hash
id: head
shell: bash
run: echo "head=$(git rev-parse HEAD)" | tee -a "${GITHUB_OUTPUT}"
- name: Cache nightly commit hash
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
with:
path: .nightly_commit_hash
key: release-nightly-${{ steps.head.outputs.head }}
restore-keys: |
release-nightly-
- name: Check for new commits
id: check_for_new_commits
shell: bash
@@ -35,7 +52,22 @@ jobs:
".github/workflows/release.yml"
".github/workflows/release-nightly.yml"
)
echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"
if [[ -f .nightly_commit_hash ]]; then
limit_args=(
"$(cat .nightly_commit_hash)..HEAD"
)
else
limit_args=(
--since="24 hours ago"
)
fi
echo "commit=$(git log --format=%H -1 "${limit_args[@]}" -- "${relevant_files[@]}")" | tee -a "${GITHUB_OUTPUT}"
- name: Record new nightly commit hash
env:
HEAD: ${{ steps.head.outputs.head }}
shell: bash
run: echo "${HEAD}" | tee .nightly_commit_hash
release:
name: Publish Github release
@@ -66,6 +98,7 @@ jobs:
with:
path: dist
name: build-pypi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:

View File

@@ -215,7 +215,7 @@ jobs:
python -m build --no-isolation .
- name: Upload artifacts
if: github.event_name != 'workflow_dispatch'
if: github.event.workflow != '.github/workflows/release.yml' # Reusable workflow_call
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: build-pypi
@@ -224,7 +224,7 @@ jobs:
compression-level: 0
- name: Publish to PyPI
if: github.event_name == 'workflow_dispatch'
if: github.event.workflow == '.github/workflows/release.yml' # Direct workflow_dispatch
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
verbose: true