37 description: Version tag (YYYY.MM.DD[.REV])
41 description: Update channel (stable/nightly)
46 description: yt-dlp, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip
50 description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l
54 description: yt-dlp_macos, yt-dlp_macos.zip
58 description: yt-dlp_macos_legacy
62 description: yt-dlp.exe, yt-dlp_min.exe, yt-dlp_win.zip
66 description: yt-dlp_x86.exe
70 description: SHA2-256SUMS, SHA2-512SUMS, _update_spec
80 runs-on: ubuntu-latest
82 - uses: actions/checkout@v3
83 - uses: actions/setup-python@v4
85 python-version: "3.10"
86 - uses: conda-incubator/setup-miniconda@v2
88 miniforge-variant: Mambaforge
91 auto-update-conda: true
92 activate-environment: ""
93 auto-activate-base: false
94 - name: Install Requirements
96 sudo apt-get -y install zip pandoc man sed
97 python -m pip install -U pip setuptools wheel
98 python -m pip install -U Pyinstaller -r requirements.txt
100 echo -e 'python=3.10.*\npyinstaller' >$reqs
101 sed 's/^brotli.*/brotli-python/' <requirements.txt >>$reqs
102 mamba create -n build --file $reqs
106 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
107 python devscripts/make_lazy_extractors.py
108 - name: Build Unix platform-independent binary
111 - name: Build Unix standalone binary
114 unset LD_LIBRARY_PATH # Harmful; set by setup-python
116 python pyinst.py --onedir
117 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
119 mv ./dist/yt-dlp_linux ./yt-dlp_linux
120 mv ./dist/yt-dlp_linux.zip ./yt-dlp_linux.zip
122 - name: Upload artifacts
123 uses: actions/upload-artifact@v3
135 packages: write # for creating cache
136 runs-on: ubuntu-latest
144 - uses: actions/checkout@v3
147 - name: Virtualized Install, Prepare & Build
148 uses: yt-dlp/run-on-arch-action@v2
150 # Ref: https://github.com/uraimo/run-on-arch-action/issues/55
152 GITHUB_WORKFLOW: build
153 githubToken: ${{ github.token }} # To cache image
154 arch: ${{ matrix.architecture }}
155 distro: ubuntu18.04 # Standalone executable should be built on minimum supported OS
156 dockerRunArgs: --volume "${PWD}/repo:/repo"
157 install: | # Installing Python 3.10 from the Deadsnakes repo raises errors
159 apt -y install zlib1g-dev python3.8 python3.8-dev python3.8-distutils python3-pip
160 python3.8 -m pip install -U pip setuptools wheel
161 # Cannot access requirements.txt from the repo directory at this stage
162 python3.8 -m pip install -U Pyinstaller mutagen pycryptodomex websockets brotli certifi
166 python3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date
167 python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
168 python3.8 devscripts/make_lazy_extractors.py
171 - name: Upload artifacts
172 uses: actions/upload-artifact@v3
174 path: | # run-on-arch-action designates armv7l as armv7
175 repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}
182 - uses: actions/checkout@v3
183 # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used
184 - name: Install Requirements
186 brew install coreutils
187 /usr/bin/python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
191 /usr/bin/python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
192 /usr/bin/python3 devscripts/make_lazy_extractors.py
195 /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir
196 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
197 /usr/bin/python3 pyinst.py --target-architecture universal2
199 - name: Upload artifacts
200 uses: actions/upload-artifact@v3
204 dist/yt-dlp_macos.zip
207 if: inputs.macos_legacy
208 runs-on: macos-latest
211 - uses: actions/checkout@v3
212 - name: Install Python
213 # We need the official Python, because the GA ones only support newer macOS versions
215 PYTHON_VERSION: 3.10.5
216 MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools
218 # Hack to get the latest patch version. Uncomment if needed
219 #brew install python@3.10
220 #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 )
221 curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg"
222 sudo installer -pkg python.pkg -target /
224 - name: Install Requirements
226 brew install coreutils
227 python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
231 python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
232 python3 devscripts/make_lazy_extractors.py
236 mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy
238 - name: Upload artifacts
239 uses: actions/upload-artifact@v3
242 dist/yt-dlp_macos_legacy
246 runs-on: windows-latest
249 - uses: actions/checkout@v3
250 - uses: actions/setup-python@v4
251 with: # 3.8 is used for Win7 support
252 python-version: "3.8"
253 - name: Install Requirements
254 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
255 python -m pip install -U pip setuptools wheel py2exe
256 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
260 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
261 python devscripts/make_lazy_extractors.py
264 python setup.py py2exe
265 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
267 python pyinst.py --onedir
268 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
270 - name: Upload artifacts
271 uses: actions/upload-artifact@v3
280 runs-on: windows-latest
283 - uses: actions/checkout@v3
284 - uses: actions/setup-python@v4
285 with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390
286 python-version: "3.7"
288 - name: Install Requirements
290 python -m pip install -U pip setuptools wheel
291 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
295 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
296 python devscripts/make_lazy_extractors.py
301 - name: Upload artifacts
302 uses: actions/upload-artifact@v3
308 if: inputs.meta_files && always()
316 runs-on: ubuntu-latest
318 - uses: actions/download-artifact@v3
320 - name: Make SHA2-SUMS files
323 sha256sum * > ../SHA2-256SUMS
324 sha512sum * > ../SHA2-512SUMS
326 - name: Make Update spec
328 cat >> _update_spec << EOF
329 # This file is used for regulating self-update
330 lock 2022.08.18.36 .+ Python 3.6
333 - name: Upload artifacts
334 uses: actions/upload-artifact@v3