[build] Harden build/release workflows (#16358)

Authored by: bashonly, Grub4K

Co-authored-by: Simon Sawicki <contact@grub4k.dev>
This commit is contained in:
bashonly
2026-03-27 19:10:58 -05:00
committed by GitHub
parent f01e1a1ced
commit 87eaf886f5
29 changed files with 5132 additions and 100 deletions

View File

@@ -6,20 +6,15 @@ if [[ -z "${PYTHON_VERSION:-}" ]]; then
echo "Defaulting to using Python ${PYTHON_VERSION}"
fi
INCLUDES=(
--include-extra pyinstaller
--include-extra secretstorage
)
if [[ -z "${EXCLUDE_CURL_CFFI:-}" ]]; then
INCLUDES+=(--include-extra build-curl-cffi)
fi
py"${PYTHON_VERSION}" -m venv /yt-dlp-build-venv
# Set up virtual environment
rm -rf .venv
py"${PYTHON_VERSION}" -m venv .venv --without-pip
PYTHONPATH="$(py"${PYTHON_VERSION}" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
export PYTHONPATH
# shellcheck disable=SC1091
source /yt-dlp-build-venv/bin/activate
# Inside the venv we can use python instead of py3.13 or py3.14 etc
python -m devscripts.install_deps "${INCLUDES[@]}"
source .venv/bin/activate
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-${REQUIREMENTS}.txt"
python -m devscripts.make_lazy_extractors
python devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}"