mirror of
https://github.com/yt-dlp/yt-dlp
synced 2026-01-16 20:04:46 -05:00
35
.github/workflows/release-nightly.yml
vendored
35
.github/workflows/release-nightly.yml
vendored
@@ -2,6 +2,7 @@ name: Release (nightly)
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '23 23 * * *'
|
- cron: '23 23 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
@@ -19,6 +20,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
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
|
- name: Check for new commits
|
||||||
id: check_for_new_commits
|
id: check_for_new_commits
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -35,7 +52,22 @@ jobs:
|
|||||||
".github/workflows/release.yml"
|
".github/workflows/release.yml"
|
||||||
".github/workflows/release-nightly.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:
|
release:
|
||||||
name: Publish Github release
|
name: Publish Github release
|
||||||
@@ -66,6 +98,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: dist
|
path: dist
|
||||||
name: build-pypi
|
name: build-pypi
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -215,7 +215,7 @@ jobs:
|
|||||||
python -m build --no-isolation .
|
python -m build --no-isolation .
|
||||||
|
|
||||||
- name: Upload artifacts
|
- 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
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: build-pypi
|
name: build-pypi
|
||||||
@@ -224,7 +224,7 @@ jobs:
|
|||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- 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
|
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|
||||||
with:
|
with:
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|||||||
Reference in New Issue
Block a user