From 1d426f1b86a6efa1ac9f5c2f4a17688bd472614e Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 12 Aug 2025 00:25:48 -0500 Subject: [PATCH] [build] Add Windows arm64 builds Authored by: bashonly --- .github/workflows/build.yml | 89 ++++++++++--------------------------- README.md | 5 ++- yt_dlp/update.py | 1 + 3 files changed, 28 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810490f735..6669804ed6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,6 @@ on: windows: default: true type: boolean - windows32: - default: true - type: boolean origin: required: false default: '' @@ -72,11 +69,7 @@ on: default: true type: boolean windows: - description: yt-dlp.exe, yt-dlp_win.zip - default: true - type: boolean - windows32: - description: yt-dlp_x86.exe + 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 origin: @@ -399,18 +392,26 @@ jobs: windows: needs: process if: inputs.windows - runs-on: windows-latest + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - { arch: 'x64', runner: 'windows-2025', suffix: '' } + - { arch: 'x86', runner: 'windows-2025', suffix: '_x86'} + - { arch: 'arm64', runner: 'windows-11-arm', suffix: '_arm64' } steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" # arm64 only has Python >= 3.11 available + architecture: ${{ matrix.arch }} - name: Install Requirements - run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds + run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds python devscripts/install_deps.py -o --include build - python devscripts/install_deps.py --include curl-cffi - python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-6.13.0-py3-none-any.whl" + python devscripts/install_deps.py ${{ (matrix.arch != 'x86' && '--include curl-cffi') || '' }} + python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/${{ matrix.arch }}/pyinstaller-6.15.0-py3-none-any.whl" - name: Prepare run: | @@ -420,12 +421,15 @@ jobs: run: | python -m bundle.pyinstaller 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 - 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: | - foreach ($name in @("yt-dlp")) { + foreach ($name in @("yt-dlp${{ matrix.suffix }}")) { 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 @@ -438,56 +442,10 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: build-bin-${{ github.job }} + name: build-bin-${{ github.job }}-win${{ matrix.suffix }} path: | - dist/yt-dlp.exe - dist/yt-dlp_win.zip - compression-level: 0 - - windows32: - needs: process - if: inputs.windows32 - runs-on: windows-latest - - steps: - - 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/i686/pyinstaller-6.13.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: | - foreach ($name in @("yt-dlp_x86")) { - 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 - uses: actions/upload-artifact@v4 - with: - name: build-bin-${{ github.job }} - path: | - dist/yt-dlp_x86.exe + dist/yt-dlp${{ matrix.suffix }}.exe + dist/yt-dlp_win${{ matrix.suffix }}.zip compression-level: 0 meta_files: @@ -500,7 +458,6 @@ jobs: - macos - macos_legacy - windows - - windows32 runs-on: ubuntu-latest steps: - name: Download artifacts diff --git a/README.md b/README.md index 9b28147f2c..53cd2c5c05 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,13 @@ #### Alternatives File|Description :---|:--- [yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win8+) standalone x86 (32-bit) binary +[yt-dlp_arm64.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_arm64.exe)|Windows (Win8+) standalone arm64 (64-bit) binary [yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary [yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary [yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary -[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update) +[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows (Win8+) x64 executable (no auto-update) +[yt-dlp_win_x86.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_x86.zip)|Unpackaged Windows (Win8+) x86 executable (no auto-update) +[yt-dlp_win_arm64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_arm64.zip)|Unpackaged Windows (Win8+) arm64 executable (no auto-update) [yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) [yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable diff --git a/yt_dlp/update.py b/yt_dlp/update.py index ca69fbbada..6bff71b5a2 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -110,6 +110,7 @@ def current_git_head(): 'zip': '', 'win_exe': '.exe', 'win_x86_exe': '_x86.exe', + 'win_arm64_exe': '_arm64.exe', 'darwin_exe': '_macos', 'darwin_legacy_exe': '_macos_legacy', 'linux_exe': '_linux',