45 VERSION: yyyy.mm.dd[.rev] or rev
50 SOURCE of this build's updates: stable/nightly/master/<repo>
55 description: yt-dlp, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip
59 description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l
63 description: yt-dlp_macos, yt-dlp_macos.zip
67 description: yt-dlp_macos_legacy
71 description: yt-dlp.exe, yt-dlp_min.exe, yt-dlp_win.zip
75 description: yt-dlp_x86.exe
79 description: SHA2-256SUMS, SHA2-512SUMS, _update_spec
85 default: 'current repo'
95 runs-on: ubuntu-latest
97 origin: ${{ steps.process_origin.outputs.origin }}
99 - name: Process origin
102 echo "origin=${{ inputs.origin == 'current repo' && github.repository || inputs.origin }}" | tee "$GITHUB_OUTPUT"
107 runs-on: ubuntu-latest
109 - uses: actions/checkout@v4
110 - uses: actions/setup-python@v4
112 python-version: "3.10"
113 - uses: conda-incubator/setup-miniconda@v2
115 miniforge-variant: Mambaforge
117 channels: conda-forge
118 auto-update-conda: true
119 activate-environment: ""
120 auto-activate-base: false
121 - name: Install Requirements
123 sudo apt -y install zip pandoc man sed
124 cat > ./requirements.txt << EOF
128 python devscripts/install_deps.py --print \
129 --exclude brotli --exclude brotlicffi \
130 --include secretstorage --include pyinstaller >> ./requirements.txt
131 mamba create -n build --file ./requirements.txt
135 python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
136 python devscripts/make_lazy_extractors.py
137 - name: Build Unix platform-independent binary
140 - name: Build Unix standalone binary
143 unset LD_LIBRARY_PATH # Harmful; set by setup-python
145 python -m bundle.pyinstaller --onedir
146 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
147 python -m bundle.pyinstaller
148 mv ./dist/yt-dlp_linux ./yt-dlp_linux
149 mv ./dist/yt-dlp_linux.zip ./yt-dlp_linux.zip
151 - name: Verify --update-to
152 if: vars.UPDATE_TO_VERIFICATION
154 binaries=("yt-dlp" "yt-dlp_linux")
155 for binary in "${binaries[@]}"; do
157 cp ./${binary} ./${binary}_downgraded
158 version="$(./${binary} --version)"
159 ./${binary}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04
160 downgraded_version="$(./${binary}_downgraded --version)"
161 [[ "$version" != "$downgraded_version" ]]
164 - name: Upload artifacts
165 uses: actions/upload-artifact@v3
178 packages: write # for creating cache
179 runs-on: ubuntu-latest
187 - uses: actions/checkout@v4
190 - name: Virtualized Install, Prepare & Build
191 uses: yt-dlp/run-on-arch-action@v2
193 # Ref: https://github.com/uraimo/run-on-arch-action/issues/55
195 GITHUB_WORKFLOW: build
196 githubToken: ${{ github.token }} # To cache image
197 arch: ${{ matrix.architecture }}
198 distro: ubuntu18.04 # Standalone executable should be built on minimum supported OS
199 dockerRunArgs: --volume "${PWD}/repo:/repo"
200 install: | # Installing Python 3.10 from the Deadsnakes repo raises errors
202 apt -y install zlib1g-dev python3.8 python3.8-dev python3.8-distutils python3-pip
203 python3.8 -m pip install -U pip setuptools wheel
204 # Cannot access any files from the repo directory at this stage
205 python3.8 -m pip install -U Pyinstaller mutagen pycryptodomex websockets brotli certifi secretstorage
209 python3.8 devscripts/install_deps.py -o --include build
210 python3.8 devscripts/install_deps.py --include pyinstaller --include secretstorage # Cached version may be out of date
211 python3.8 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
212 python3.8 devscripts/make_lazy_extractors.py
213 python3.8 -m bundle.pyinstaller
215 if ${{ vars.UPDATE_TO_VERIFICATION && 'true' || 'false' }}; then
216 arch="${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}"
217 chmod +x ./dist/yt-dlp_linux_${arch}
218 cp ./dist/yt-dlp_linux_${arch} ./dist/yt-dlp_linux_${arch}_downgraded
219 version="$(./dist/yt-dlp_linux_${arch} --version)"
220 ./dist/yt-dlp_linux_${arch}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04
221 downgraded_version="$(./dist/yt-dlp_linux_${arch}_downgraded --version)"
222 [[ "$version" != "$downgraded_version" ]]
225 - name: Upload artifacts
226 uses: actions/upload-artifact@v3
228 path: | # run-on-arch-action designates armv7l as armv7
229 repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}
237 - uses: actions/checkout@v4
238 # NB: Building universal2 does not work with python from actions/setup-python
239 - name: Install Requirements
241 brew install coreutils
242 python3 devscripts/install_deps.py --user -o --include build
243 python3 devscripts/install_deps.py --print --include pyinstaller > requirements.txt
244 # We need to ignore wheels otherwise we break universal2 builds
245 python3 -m pip install -U --user --no-binary :all: -r requirements.txt
249 python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
250 python3 devscripts/make_lazy_extractors.py
253 python3 -m bundle.pyinstaller --target-architecture universal2 --onedir
254 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
255 python3 -m bundle.pyinstaller --target-architecture universal2
257 - name: Verify --update-to
258 if: vars.UPDATE_TO_VERIFICATION
260 chmod +x ./dist/yt-dlp_macos
261 cp ./dist/yt-dlp_macos ./dist/yt-dlp_macos_downgraded
262 version="$(./dist/yt-dlp_macos --version)"
263 ./dist/yt-dlp_macos_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04
264 downgraded_version="$(./dist/yt-dlp_macos_downgraded --version)"
265 [[ "$version" != "$downgraded_version" ]]
267 - name: Upload artifacts
268 uses: actions/upload-artifact@v3
272 dist/yt-dlp_macos.zip
276 if: inputs.macos_legacy
277 runs-on: macos-latest
280 - uses: actions/checkout@v4
281 - name: Install Python
282 # We need the official Python, because the GA ones only support newer macOS versions
284 PYTHON_VERSION: 3.10.5
285 MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools
287 # Hack to get the latest patch version. Uncomment if needed
288 #brew install python@3.10
289 #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 )
290 curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg"
291 sudo installer -pkg python.pkg -target /
293 - name: Install Requirements
295 brew install coreutils
296 python3 devscripts/install_deps.py --user -o --include build
297 python3 devscripts/install_deps.py --user --include pyinstaller
301 python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
302 python3 devscripts/make_lazy_extractors.py
305 python3 -m bundle.pyinstaller
306 mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy
308 - name: Verify --update-to
309 if: vars.UPDATE_TO_VERIFICATION
311 chmod +x ./dist/yt-dlp_macos_legacy
312 cp ./dist/yt-dlp_macos_legacy ./dist/yt-dlp_macos_legacy_downgraded
313 version="$(./dist/yt-dlp_macos_legacy --version)"
314 ./dist/yt-dlp_macos_legacy_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04
315 downgraded_version="$(./dist/yt-dlp_macos_legacy_downgraded --version)"
316 [[ "$version" != "$downgraded_version" ]]
318 - name: Upload artifacts
319 uses: actions/upload-artifact@v3
322 dist/yt-dlp_macos_legacy
327 runs-on: windows-latest
330 - uses: actions/checkout@v4
331 - uses: actions/setup-python@v4
332 with: # 3.8 is used for Win7 support
333 python-version: "3.8"
334 - name: Install Requirements
335 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
336 python devscripts/install_deps.py -o --include build
337 python devscripts/install_deps.py --include py2exe
338 python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl"
342 python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
343 python devscripts/make_lazy_extractors.py
346 python -m bundle.py2exe
347 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
348 python -m bundle.pyinstaller
349 python -m bundle.pyinstaller --onedir
350 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
352 - name: Verify --update-to
353 if: vars.UPDATE_TO_VERIFICATION
355 foreach ($name in @("yt-dlp","yt-dlp_min")) {
356 Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe"
357 $version = & "./dist/${name}.exe" --version
358 & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04
359 $downgraded_version = & "./dist/${name}_downgraded.exe" --version
360 if ($version -eq $downgraded_version) {
365 - name: Upload artifacts
366 uses: actions/upload-artifact@v3
376 runs-on: windows-latest
379 - uses: actions/checkout@v4
380 - uses: actions/setup-python@v4
382 python-version: "3.8"
384 - name: Install Requirements
386 python devscripts/install_deps.py -o --include build
387 python devscripts/install_deps.py
388 python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.8.0-py3-none-any.whl"
392 python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"
393 python devscripts/make_lazy_extractors.py
396 python -m bundle.pyinstaller
398 - name: Verify --update-to
399 if: vars.UPDATE_TO_VERIFICATION
401 foreach ($name in @("yt-dlp_x86")) {
402 Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe"
403 $version = & "./dist/${name}.exe" --version
404 & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04
405 $downgraded_version = & "./dist/${name}_downgraded.exe" --version
406 if ($version -eq $downgraded_version) {
411 - name: Upload artifacts
412 uses: actions/upload-artifact@v3
418 if: inputs.meta_files && always() && !cancelled()
427 runs-on: ubuntu-latest
429 - uses: actions/download-artifact@v3
431 - name: Make SHA2-SUMS files
434 sha256sum * > ../SHA2-256SUMS
435 sha512sum * > ../SHA2-512SUMS
437 - name: Make Update spec
439 cat >> _update_spec << EOF
440 # This file is used for regulating self-update
441 lock 2022.08.18.36 .+ Python 3\.6
442 lock 2023.11.16 (?!win_x86_exe).+ Python 3\.7
443 lock 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)
444 lockV2 yt-dlp/yt-dlp 2022.08.18.36 .+ Python 3\.6
445 lockV2 yt-dlp/yt-dlp 2023.11.16 (?!win_x86_exe).+ Python 3\.7
446 lockV2 yt-dlp/yt-dlp 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)
447 lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 (?!win_x86_exe).+ Python 3\.7
448 lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 win_x86_exe .+ Windows-(?:Vista|2008Server)
449 lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 (?!win_x86_exe).+ Python 3\.7
450 lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 win_x86_exe .+ Windows-(?:Vista|2008Server)
453 - name: Sign checksum files
455 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
456 if: env.GPG_SIGNING_KEY != ''
458 gpg --batch --import <<< "${{ secrets.GPG_SIGNING_KEY }}"
459 for signfile in ./SHA*SUMS; do
460 gpg --batch --detach-sign "$signfile"
463 - name: Upload artifacts
464 uses: actions/upload-artifact@v3