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
109 sed '/^brotli.*/d' requirements.txt >> $reqs
110 mamba create -n build --file $reqs
114 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
115 python devscripts/make_lazy_extractors.py
116 - name: Build Unix platform-independent binary
119 - name: Build Unix standalone binary
122 unset LD_LIBRARY_PATH # Harmful; set by setup-python
124 python pyinst.py --onedir
125 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
127 mv ./dist/yt-dlp_linux ./yt-dlp_linux
128 mv ./dist/yt-dlp_linux.zip ./yt-dlp_linux.zip
130 - name: Upload artifacts
131 uses: actions/upload-artifact@v3
143 packages: write # for creating cache
144 runs-on: ubuntu-latest
152 - uses: actions/checkout@v3
155 - name: Virtualized Install, Prepare & Build
156 uses: yt-dlp/run-on-arch-action@v2
158 # Ref: https://github.com/uraimo/run-on-arch-action/issues/55
160 GITHUB_WORKFLOW: build
161 githubToken: ${{ github.token }} # To cache image
162 arch: ${{ matrix.architecture }}
163 distro: ubuntu18.04 # Standalone executable should be built on minimum supported OS
164 dockerRunArgs: --volume "${PWD}/repo:/repo"
165 install: | # Installing Python 3.10 from the Deadsnakes repo raises errors
167 apt -y install zlib1g-dev python3.8 python3.8-dev python3.8-distutils python3-pip
168 python3.8 -m pip install -U pip setuptools wheel
169 # Cannot access requirements.txt from the repo directory at this stage
170 python3.8 -m pip install -U Pyinstaller mutagen pycryptodomex websockets brotli certifi
174 python3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date
175 python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
176 python3.8 devscripts/make_lazy_extractors.py
179 - name: Upload artifacts
180 uses: actions/upload-artifact@v3
182 path: | # run-on-arch-action designates armv7l as armv7
183 repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}
190 - uses: actions/checkout@v3
191 # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used
192 - name: Install Requirements
194 brew install coreutils
195 /usr/bin/python3 -m pip install -U --user pip Pyinstaller==5.8 -r requirements.txt
199 /usr/bin/python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
200 /usr/bin/python3 devscripts/make_lazy_extractors.py
203 /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir
204 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
205 /usr/bin/python3 pyinst.py --target-architecture universal2
207 - name: Upload artifacts
208 uses: actions/upload-artifact@v3
212 dist/yt-dlp_macos.zip
215 if: inputs.macos_legacy
216 runs-on: macos-latest
219 - uses: actions/checkout@v3
220 - name: Install Python
221 # We need the official Python, because the GA ones only support newer macOS versions
223 PYTHON_VERSION: 3.10.5
224 MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools
226 # Hack to get the latest patch version. Uncomment if needed
227 #brew install python@3.10
228 #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 )
229 curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg"
230 sudo installer -pkg python.pkg -target /
232 - name: Install Requirements
234 brew install coreutils
235 python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
239 python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
240 python3 devscripts/make_lazy_extractors.py
244 mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy
246 - name: Upload artifacts
247 uses: actions/upload-artifact@v3
250 dist/yt-dlp_macos_legacy
254 runs-on: windows-latest
257 - uses: actions/checkout@v3
258 - uses: actions/setup-python@v4
259 with: # 3.8 is used for Win7 support
260 python-version: "3.8"
261 - name: Install Requirements
262 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
263 python -m pip install -U pip setuptools wheel py2exe
264 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
268 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
269 python devscripts/make_lazy_extractors.py
272 python setup.py py2exe
273 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
275 python pyinst.py --onedir
276 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
278 - name: Upload artifacts
279 uses: actions/upload-artifact@v3
288 runs-on: windows-latest
291 - uses: actions/checkout@v3
292 - uses: actions/setup-python@v4
293 with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390
294 python-version: "3.7"
296 - name: Install Requirements
298 python -m pip install -U pip setuptools wheel
299 pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.8.0-py3-none-any.whl" -r requirements.txt
303 python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}
304 python devscripts/make_lazy_extractors.py
309 - name: Upload artifacts
310 uses: actions/upload-artifact@v3
316 if: inputs.meta_files && always()
324 runs-on: ubuntu-latest
326 - uses: actions/download-artifact@v3
328 - name: Make SHA2-SUMS files
331 sha256sum * > ../SHA2-256SUMS
332 sha512sum * > ../SHA2-512SUMS
334 - name: Make Update spec
336 cat >> _update_spec << EOF
337 # This file is used for regulating self-update
338 lock 2022.08.18.36 .+ Python 3.6
341 - name: Sign checksum files
343 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
344 if: env.GPG_SIGNING_KEY != ''
346 gpg --batch --import <<< "${{ secrets.GPG_SIGNING_KEY }}"
347 for signfile in ./SHA*SUMS; do
348 gpg --batch --detach-sign "$signfile"
351 - name: Upload artifacts
352 uses: actions/upload-artifact@v3