@ -24,9 +24,6 @@ on:
windows:
windows:
default : true
default : true
type : boolean
type : boolean
windows32:
default : true
type : boolean
origin:
origin:
required : false
required : false
default : ''
default : ''
@ -65,11 +62,7 @@ on:
default : true
default : true
type : boolean
type : boolean
windows:
windows:
description : yt-dlp.exe, yt-dlp_win.zip
description : yt-dlp.exe, yt-dlp_win.zip, yt-dlp_x86.exe, yt-dlp_win_x86.zip, yt-dlp_arm64.exe, yt-dlp_win_arm64.zip
default : true
type : boolean
windows32:
description : yt-dlp_x86.exe
default : true
default : true
type : boolean
type : boolean
origin:
origin:
@ -340,18 +333,53 @@ jobs:
windows:
windows:
needs : process
needs : process
if : inputs.windows
if : inputs.windows
runs-on : windows-latest
permissions:
contents : read
actions : write # For cleaning up cache
runs-on : ${{ matrix.runner }}
strategy:
fail-fast : false
matrix:
include:
- arch : 'x64'
runner : windows-2025
suffix : ''
python_version : '3.10'
- arch : 'x86'
runner : windows-2025
suffix : '_x86'
python_version : '3.10'
- arch : 'arm64'
runner : windows-11-arm
suffix : '_arm64'
python_version : '3.13' # arm64 only has Python >= 3.11 available
steps:
steps:
- uses : actions/checkout@v4
- uses : actions/checkout@v4
- uses : actions/setup-python@v5
- uses : actions/setup-python@v5
with:
with:
python-version : "3.10"
python-version : ${{ matrix.python_version }}
architecture : ${{ matrix.arch }}
- name : Restore cached requirements
id : restore-cache
if : matrix.arch == 'arm64'
uses : actions/cache/restore@v4
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS : 1
with:
path : |
/yt-dlp-build-venv
key : cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }}
- name : Install Requirements
- name : Install Requirements
run : | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
run : |
python -m venv /yt-dlp-build-venv
/yt-dlp-build-venv/Scripts/Activate.ps1
python devscripts/install_deps.py -o --include build
python devscripts/install_deps.py -o --include build
python devscripts/install_deps.py --include curl-cffi
python devscripts/install_deps.py ${{ (matrix.arch != 'x86' && '--include curl-cffi') || '' }}
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x64/pyinstaller-6.15.0-py3-none-any.whl"
# Use custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/${{ matrix.arch }}/pyinstaller-6.15.0-py3-none-any.whl"
- name : Prepare
- name : Prepare
run : |
run : |
@ -359,14 +387,18 @@ jobs:
python devscripts/make_lazy_extractors.py
python devscripts/make_lazy_extractors.py
- name : Build
- name : Build
run : |
run : |
/yt-dlp-build-venv/Scripts/Activate.ps1
python -m bundle.pyinstaller
python -m bundle.pyinstaller
python -m bundle.pyinstaller --onedir
python -m bundle.pyinstaller --onedir
Compress-Archive -Path ./dist/yt-dlp /* -DestinationPath ./dist/yt-dlp_win.zip
Compress-Archive -Path ./dist/yt-dlp ${{ matrix.suffix }} /* -DestinationPath ./dist/yt-dlp_win${{ matrix.suffix }} .zip
- name : Verify --update-to
- name : Verify --update-to
if : vars.UPDATE_TO_VERIFICATION
# if: vars.UPDATE_TO_VERIFICATION
# Temporarily skip for arm64 until there is a release that it can --update-to
if : |
vars.UPDATE_TO_VERIFICATION && matrix.arch != 'arm64'
run : |
run : |
foreach ($name in @("yt-dlp")) {
foreach ($name in @("yt-dlp ${{ matrix.suffix }} ")) {
Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe"
Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe"
$version = & "./dist/${name}.exe" --version
$version = & "./dist/${name}.exe" --version
& "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04
& "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04
@ -376,60 +408,42 @@ jobs:
}
}
}
}
# TODO: remove when there is a windows_arm64 release that we can --update-to
- name : Verify arm64 executable
if : |
vars.UPDATE_TO_VERIFICATION && matrix.arch == 'arm64'
run : |
foreach ($name in @("yt-dlp${{ matrix.suffix }}")) {
& "./dist/${name}.exe" -v --print-traffic --impersonate chrome "https://tls.browserleaks.com/json" -o ./resp.json
& cat ./resp.json
& "./dist/${name}.exe" --version
}
- name : Upload artifacts
- name : Upload artifacts
uses : actions/upload-artifact@v4
uses : actions/upload-artifact@v4
with:
with:
name : build-bin-${{ github.job }}
name : build-bin-${{ github.job }} -${{ matrix.arch }}
path : |
path : |
dist/yt-dlp.exe
dist/yt-dlp ${{ matrix.suffix }} .exe
dist/yt-dlp_win.zip
dist/yt-dlp_win ${{ matrix.suffix }} .zip
compression-level : 0
compression-level : 0
windows32:
- name : Cleanup cache
needs : process
if : |
if : inputs.windows32
matrix.arch == 'arm64' && steps.restore-cache.outputs.cache-hit == 'true'
runs-on : windows-latest
env:
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
steps:
cache_key : cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }}
- uses : actions/checkout@v4
- uses : actions/setup-python@v5
with:
python-version : "3.10"
architecture : "x86"
- name : Install Requirements
run : |
python devscripts/install_deps.py -o --include build
python devscripts/install_deps.py
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86/pyinstaller-6.15.0-py3-none-any.whl"
- name : Prepare
run : |
python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
python devscripts/make_lazy_extractors.py
- name : Build
run : |
python -m bundle.pyinstaller
- name : Verify --update-to
if : vars.UPDATE_TO_VERIFICATION
run : |
run : |
foreach ($name in @("yt-dlp_x86")) {
gh cache delete "${cache_key}"
Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe"
$version = & "./dist/${name}.exe" --version
& "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04
$downgraded_version = & "./dist/${name}_downgraded.exe" --version
if ($version -eq $downgraded_version) {
exit 1
}
}
- name : Upload artifacts
- name : Cache requirements
uses : actions/upload-artifact@v4
if : matrix.arch == 'arm64'
uses : actions/cache/save@v4
with:
with:
name : build-bin-${{ github.job }}
path : |
path : |
dist/yt-dlp_x86.exe
/yt-dlp-build-venv
compression-level: 0
key : cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }}
meta_files:
meta_files:
if : always() && !cancelled()
if : always() && !cancelled()
@ -440,7 +454,6 @@ jobs:
- linux_arm
- linux_arm
- macos
- macos
- windows
- windows
- windows32
runs-on : ubuntu-latest
runs-on : ubuntu-latest
steps:
steps:
- name : Download artifacts
- name : Download artifacts