meta_files:
default: true
type: boolean
+ origin:
+ required: false
+ default: ''
+ type: string
secrets:
GPG_SIGNING_KEY:
required: false
workflow_dispatch:
inputs:
version:
- description: Version tag (YYYY.MM.DD[.REV])
+ description: |
+ VERSION: yyyy.mm.dd[.rev] or rev
required: true
type: string
channel:
- description: Update channel (stable/nightly/...)
+ description: |
+ SOURCE of this build's updates: stable/nightly/master/<repo>
required: true
default: stable
type: string
description: SHA2-256SUMS, SHA2-512SUMS, _update_spec
default: true
type: boolean
+ origin:
+ description: .
+ required: false
+ default: ''
+ type: choice
+ options:
+ - ''
permissions:
contents: read
jobs:
+ process:
+ runs-on: ubuntu-latest
+ outputs:
+ origin: ${{ steps.process_origin.outputs.origin }}
+ steps:
+ - name: Process origin
+ id: process_origin
+ run: |
+ echo "origin=${{ inputs.origin || github.repository }}" >> "$GITHUB_OUTPUT"
+
unix:
+ needs: process
if: inputs.unix
runs-on: ubuntu-latest
steps:
- name: Prepare
run: |
- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python devscripts/make_lazy_extractors.py
- name: Build Unix platform-independent binary
run: |
yt-dlp_linux.zip
linux_arm:
+ needs: process
if: inputs.linux_arm
permissions:
contents: read
run: |
cd repo
python3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date
- python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python3.8 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python3.8 devscripts/make_lazy_extractors.py
python3.8 pyinst.py
repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}
macos:
+ needs: process
if: inputs.macos
runs-on: macos-11
- name: Prepare
run: |
- python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python3 devscripts/make_lazy_extractors.py
- name: Build
run: |
dist/yt-dlp_macos.zip
macos_legacy:
+ needs: process
if: inputs.macos_legacy
runs-on: macos-latest
- name: Prepare
run: |
- python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python3 devscripts/make_lazy_extractors.py
- name: Build
run: |
dist/yt-dlp_macos_legacy
windows:
+ needs: process
if: inputs.windows
runs-on: windows-latest
- name: Prepare
run: |
- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python devscripts/make_lazy_extractors.py
- name: Build
run: |
dist/yt-dlp_win.zip
windows32:
+ needs: process
if: inputs.windows32
runs-on: windows-latest
- name: Prepare
run: |
- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python devscripts/make_lazy_extractors.py
- name: Build
run: |
meta_files:
if: inputs.meta_files && always() && !cancelled()
needs:
+ - process
- unix
- linux_arm
- macos
revision="${{ (inputs.prerelease || !vars.PUSH_VERSION_COMMIT) && '$(date -u +"%H%M%S")' || '' }}"
version="$(
- python devscripts/update-version.py -c "${resolved_source}" ${{ inputs.version || '$revision' }} | \
+ python devscripts/update-version.py \
+ -c "${resolved_source}" -r "${{ github.repository }}" ${{ inputs.version || '$revision' }} | \
grep -Po "version=\K\d+\.\d+\.\d+(\.\d+)?")"
if [[ "${target_repo}" ]]; then
with:
version: ${{ needs.prepare.outputs.version }}
channel: ${{ needs.prepare.outputs.channel }}
+ origin: ${{ needs.prepare.outputs.target_repo }}
permissions:
contents: read
packages: write # For package cache
clean_proxies,
std_headers,
)
-from .version import CHANNEL, RELEASE_GIT_HEAD, VARIANT, __version__
+from .version import CHANNEL, ORIGIN, RELEASE_GIT_HEAD, VARIANT, __version__
if compat_os_name == 'nt':
import ctypes
'version': __version__,
'current_git_head': current_git_head(),
'release_git_head': RELEASE_GIT_HEAD,
- 'repository': REPOSITORY,
+ 'repository': ORIGIN,
})
if remove_private_keys:
source += '*'
klass = type(self)
write_debug(join_nonempty(
- f'{"yt-dlp" if REPOSITORY == "yt-dlp/yt-dlp" else REPOSITORY} version',
- f'{CHANNEL}@{__version__}',
+ f'{REPOSITORY.rpartition("/")[2]} version',
+ f'{CHANNEL.rpartition("@")[2]}@{__version__}',
+ not ORIGIN.startswith('yt-dlp/') and f'from {ORIGIN}',
f'[{RELEASE_GIT_HEAD[:9]}]' if RELEASE_GIT_HEAD else '',
'' if source == 'unknown' else f'({source})',
'' if _IN_CLI else 'API' if klass == YoutubeDL else f'API:{self.__module__}.{klass.__qualname__}',