[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

@@ -9,6 +9,7 @@ services:
args:
BUILDIMAGE: ghcr.io/yt-dlp/manylinux2014_x86_64-shared:latest
environment:
REQUIREMENTS: linux-x86_64
EXE_NAME: ${EXE_NAME:?}
CHANNEL: ${CHANNEL:?}
ORIGIN: ${ORIGIN:?}
@@ -44,6 +45,7 @@ services:
args:
BUILDIMAGE: ghcr.io/yt-dlp/manylinux2014_aarch64-shared:latest
environment:
REQUIREMENTS: linux-aarch64
EXE_NAME: ${EXE_NAME:?}
CHANNEL: ${CHANNEL:?}
ORIGIN: ${ORIGIN:?}
@@ -79,6 +81,7 @@ services:
args:
BUILDIMAGE: ghcr.io/yt-dlp/manylinux_2_31_armv7l-shared:latest
environment:
REQUIREMENTS: linux-armv7l
EXE_NAME: ${EXE_NAME:?}
CHANNEL: ${CHANNEL:?}
ORIGIN: ${ORIGIN:?}
@@ -88,7 +91,6 @@ services:
SKIP_ONEFILE_BUILD:
volumes:
- ../..:/yt-dlp
- ../../venv:/yt-dlp-build-venv
linux_armv7l_verify:
build:
@@ -115,6 +117,7 @@ services:
args:
BUILDIMAGE: ghcr.io/yt-dlp/musllinux_1_2_x86_64-shared:latest
environment:
REQUIREMENTS: musllinux-x86_64
EXE_NAME: ${EXE_NAME:?}
CHANNEL: ${CHANNEL:?}
ORIGIN: ${ORIGIN:?}
@@ -150,6 +153,7 @@ services:
args:
BUILDIMAGE: ghcr.io/yt-dlp/musllinux_1_2_aarch64-shared:latest
environment:
REQUIREMENTS: musllinux-aarch64
EXE_NAME: ${EXE_NAME:?}
CHANNEL: ${CHANNEL:?}
ORIGIN: ${ORIGIN:?}
@@ -157,7 +161,6 @@ services:
PYTHON_VERSION:
SKIP_ONEDIR_BUILD:
SKIP_ONEFILE_BUILD:
EXCLUDE_CURL_CFFI: "1"
volumes:
- ../..:/yt-dlp

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}"