40 description: Version tag (YYYY.MM.DD[.REV])
44 description: Update channel (stable/nightly)
49 description: yt-dlp, yt-dlp.tar.gz, yt-dlp_linux, yt-dlp_linux.zip
53 description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l
57 description: yt-dlp_macos, yt-dlp_macos.zip
61 description: yt-dlp_macos_legacy
65 description: yt-dlp.exe, yt-dlp_min.exe, yt-dlp_win.zip
69 description: yt-dlp_x86.exe
73 description: SHA2-256SUMS, SHA2-512SUMS, _update_spec
83 runs-on: ubuntu-latest
85 - uses: actions/checkout@v3
86 - uses: actions/setup-python@v4
88 python-version: "3.10"
89 - uses: conda-incubator/setup-miniconda@v2
91 miniforge-variant: Mambaforge
94 auto-update-conda: true
95 activate-environment: ""
96 auto-activate-base: false
97 - name: Install Requirements
99 sudo apt-get -y install zip pandoc man sed
100 python -m pip install -U pip setuptools wheel
101 python -m pip install -U Pyinstaller -r requirements.txt
103 echo -e 'python=3.10.*\npyinstaller' >$reqs
104 sed 's/^brotli.*/brotli-python/' <requirements.txt >>$reqs
105 mamba create -n build --file $reqs
109 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
110 python devscripts/make_lazy_extractors.py
111 - name: Build Unix platform-independent binary
114 - name: Build Unix standalone binary
117 unset LD_LIBRARY_PATH # Harmful; set by setup-python
119 python pyinst.py --onedir
120 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
122 mv ./dist/yt-dlp_linux ./yt-dlp_linux
123 mv ./dist/yt-dlp_linux.zip ./yt-dlp_linux.zip
125 - name: Upload artifacts
126 uses: actions/upload-artifact@v3
138 packages: write # for creating cache
139 runs-on: ubuntu-latest
147 - uses: actions/checkout@v3
150 - name: Virtualized Install, Prepare & Build
151 uses: yt-dlp/run-on-arch-action@v2
153 # Ref: https://github.com/uraimo/run-on-arch-action/issues/55
155 GITHUB_WORKFLOW: build
156 githubToken: ${{ github.token }} # To cache image
157 arch: ${{ matrix.architecture }}
158 distro: ubuntu18.04 # Standalone executable should be built on minimum supported OS
159 dockerRunArgs: --volume "${PWD}/repo:/repo"
160 install: | # Installing Python 3.10 from the Deadsnakes repo raises errors
162 apt -y install zlib1g-dev python3.8 python3.8-dev python3.8-distutils python3-pip
163 python3.8 -m pip install -U pip setuptools wheel
164 # Cannot access requirements.txt from the repo directory at this stage
165 python3.8 -m pip install -U Pyinstaller mutagen pycryptodomex websockets brotli certifi
169 python3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date
170 python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
171 python3.8 devscripts/make_lazy_extractors.py
174 - name: Upload artifacts
175 uses: actions/upload-artifact@v3
177 path: | # run-on-arch-action designates armv7l as armv7
178 repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}
185 - uses: actions/checkout@v3
186 # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used
187 - name: Install Requirements
189 brew install coreutils
190 /usr/bin/python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
194 /usr/bin/python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
195 /usr/bin/python3 devscripts/make_lazy_extractors.py
198 /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir
199 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
200 /usr/bin/python3 pyinst.py --target-architecture universal2
202 - name: Upload artifacts
203 uses: actions/upload-artifact@v3
207 dist/yt-dlp_macos.zip
210 if: inputs.macos_legacy
211 runs-on: macos-latest
214 - uses: actions/checkout@v3
215 - name: Install Python
216 # We need the official Python, because the GA ones only support newer macOS versions
218 PYTHON_VERSION: 3.10.5
219 MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools
221 # Hack to get the latest patch version. Uncomment if needed
222 #brew install python@3.10
223 #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 )
224 curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg"
225 sudo installer -pkg python.pkg -target /
227 - name: Install Requirements
229 brew install coreutils
230 python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
234 python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
235 python3 devscripts/make_lazy_extractors.py
239 mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy
241 - name: Upload artifacts
242 uses: actions/upload-artifact@v3
245 dist/yt-dlp_macos_legacy
249 runs-on: windows-latest
252 - uses: actions/checkout@v3
253 - uses: actions/setup-python@v4
254 with: # 3.8 is used for Win7 support
255 python-version: "3.8"
256 - name: Install Requirements
257 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
258 python -m pip install -U pip setuptools wheel py2exe
259 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
263 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
264 python devscripts/make_lazy_extractors.py
267 python setup.py py2exe
268 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
270 python pyinst.py --onedir
271 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
273 - name: Upload artifacts
274 uses: actions/upload-artifact@v3
283 runs-on: windows-latest
286 - uses: actions/checkout@v3
287 - uses: actions/setup-python@v4
288 with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390
289 python-version: "3.7"
291 - name: Install Requirements
293 python -m pip install -U pip setuptools wheel
294 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
298 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
299 python devscripts/make_lazy_extractors.py
304 - name: Upload artifacts
305 uses: actions/upload-artifact@v3
311 if: inputs.meta_files && always()
319 runs-on: ubuntu-latest
321 - uses: actions/download-artifact@v3
323 - name: Make SHA2-SUMS files
326 sha256sum * > ../SHA2-256SUMS
327 sha512sum * > ../SHA2-512SUMS
329 - name: Make Update spec
331 cat >> _update_spec << EOF
332 # This file is used for regulating self-update
333 lock 2022.08.18.36 .+ Python 3.6
336 - name: Sign checksum files
338 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
339 if: env.GPG_SIGNING_KEY != ''
341 gpg --batch --import <<< "${{ secrets.GPG_SIGNING_KEY }}"
342 for signfile in ./SHA*SUMS; do
343 gpg --batch --detach-sign "$signfile"
346 - name: Upload artifacts
347 uses: actions/upload-artifact@v3