8 version_suffix: ${{ steps.version_suffix.outputs.version_suffix }}
9 ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }}
10 head_sha: ${{ steps.push_release.outputs.head_sha }}
12 - uses: actions/checkout@v3
15 - uses: actions/setup-python@v4
17 python-version: '3.10'
19 - name: Set version suffix
22 PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }}
23 if: "env.PUSH_VERSION_COMMIT == ''"
24 run: echo "version_suffix=$(date -u +"%H%M%S")" >> "$GITHUB_OUTPUT"
28 python devscripts/update-version.py ${{ steps.version_suffix.outputs.version_suffix }}
31 - name: Push to release
34 git config --global user.name github-actions
35 git config --global user.email github-actions@example.com
37 git commit -m "[version] update" -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all :ci run dl"
38 git push origin --force ${{ github.event.ref }}:release
39 echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
42 PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }}
43 if: "env.PUSH_VERSION_COMMIT != ''"
44 run: git push origin ${{ github.event.ref }}
49 runs-on: ubuntu-18.04 # Standalone executable should be built on minimum supported OS
52 - uses: actions/checkout@v3
53 - uses: actions/setup-python@v4
55 python-version: '3.10'
56 - name: Install Requirements
58 sudo apt-get -y install zip pandoc man
59 python -m pip install --upgrade pip setuptools wheel twine
60 python -m pip install Pyinstaller -r requirements.txt
64 python devscripts/update-version.py ${{ needs.prepare.outputs.version_suffix }}
65 python devscripts/make_lazy_extractors.py
66 - name: Build Unix executables
69 python pyinst.py --onedir
70 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
76 - name: Upload artifacts
77 uses: actions/upload-artifact@v3
85 - name: Build and publish on PyPi
87 TWINE_USERNAME: __token__
88 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
89 if: "env.TWINE_PASSWORD != ''"
92 python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update"
93 python setup.py sdist bdist_wheel
96 - name: Install SSH private key for Homebrew
98 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
99 if: "env.BREW_TOKEN != ''"
100 uses: yt-dlp/ssh-agent@v0.5.3
102 ssh-private-key: ${{ env.BREW_TOKEN }}
103 - name: Update Homebrew Formulae
105 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
106 if: "env.BREW_TOKEN != ''"
108 git clone git@github.com:yt-dlp/homebrew-taps taps/
109 python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ needs.prepare.outputs.ytdlp_version }}"
110 git -C taps/ config user.name github-actions
111 git -C taps/ config user.email github-actions@example.com
112 git -C taps/ commit -am 'yt-dlp: ${{ needs.prepare.outputs.ytdlp_version }}'
121 - uses: actions/checkout@v3
122 # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used
123 - name: Install Requirements
125 brew install coreutils
126 /usr/bin/python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
130 /usr/bin/python3 devscripts/update-version.py ${{ needs.prepare.outputs.version_suffix }}
131 /usr/bin/python3 devscripts/make_lazy_extractors.py
134 /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir
135 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
136 /usr/bin/python3 pyinst.py --target-architecture universal2
138 - name: Upload artifacts
139 uses: actions/upload-artifact@v3
143 dist/yt-dlp_macos.zip
147 runs-on: macos-latest
151 - uses: actions/checkout@v3
152 - name: Install Python
153 # We need the official Python, because the GA ones only support newer macOS versions
155 PYTHON_VERSION: 3.10.5
156 MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools
158 # Hack to get the latest patch version. Uncomment if needed
159 #brew install python@3.10
160 #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 )
161 curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o "python.pkg"
162 sudo installer -pkg python.pkg -target /
164 - name: Install Requirements
166 brew install coreutils
167 python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
171 python3 devscripts/update-version.py ${{ needs.prepare.outputs.version_suffix }}
172 python3 devscripts/make_lazy_extractors.py
176 mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy
178 - name: Upload artifacts
179 uses: actions/upload-artifact@v3
182 dist/yt-dlp_macos_legacy
186 runs-on: windows-latest
190 - uses: actions/checkout@v3
191 - uses: actions/setup-python@v4
192 with: # 3.8 is used for Win7 support
193 python-version: '3.8'
194 - name: Install Requirements
195 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
196 python -m pip install --upgrade pip setuptools wheel "py2exe<0.12"
197 pip install "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.3-py3-none-any.whl" -r requirements.txt
201 python devscripts/update-version.py ${{ needs.prepare.outputs.version_suffix }}
202 python devscripts/make_lazy_extractors.py
205 python setup.py py2exe
206 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
208 python pyinst.py --onedir
209 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
211 - name: Upload artifacts
212 uses: actions/upload-artifact@v3
221 runs-on: windows-latest
225 - uses: actions/checkout@v3
226 - uses: actions/setup-python@v4
227 with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390
228 python-version: '3.7'
230 - name: Install Requirements
232 python -m pip install --upgrade pip setuptools wheel
233 pip install "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-5.3-py3-none-any.whl" -r requirements.txt
237 python devscripts/update-version.py ${{ needs.prepare.outputs.version_suffix }}
238 python devscripts/make_lazy_extractors.py
243 - name: Upload artifacts
244 uses: actions/upload-artifact@v3
251 runs-on: ubuntu-latest
252 needs: [prepare, build_unix, build_windows, build_windows32, build_macos, build_macos_legacy]
255 - uses: actions/checkout@v3
256 - uses: actions/download-artifact@v3
258 - name: Get Changelog
260 changelog=$(grep -oPz '(?s)(?<=### ${{ needs.prepare.outputs.ytdlp_version }}\n{2}).+?(?=\n{2,3}###)' Changelog.md) || true
261 echo "changelog<<EOF" >> $GITHUB_ENV
262 echo "$changelog" >> $GITHUB_ENV
263 echo "EOF" >> $GITHUB_ENV
264 - name: Make Update spec
266 echo "# This file is used for regulating self-update" >> _update_spec
267 echo "lock 2022.07.18 .+ Python 3.6" >> _update_spec
268 - name: Make SHA2-SUMS files
270 sha256sum artifact/yt-dlp | awk '{print $1 " yt-dlp"}' >> SHA2-256SUMS
271 sha256sum artifact/yt-dlp.tar.gz | awk '{print $1 " yt-dlp.tar.gz"}' >> SHA2-256SUMS
272 sha256sum artifact/yt-dlp.exe | awk '{print $1 " yt-dlp.exe"}' >> SHA2-256SUMS
273 sha256sum artifact/yt-dlp_win.zip | awk '{print $1 " yt-dlp_win.zip"}' >> SHA2-256SUMS
274 sha256sum artifact/yt-dlp_min.exe | awk '{print $1 " yt-dlp_min.exe"}' >> SHA2-256SUMS
275 sha256sum artifact/yt-dlp_x86.exe | awk '{print $1 " yt-dlp_x86.exe"}' >> SHA2-256SUMS
276 sha256sum artifact/yt-dlp_macos | awk '{print $1 " yt-dlp_macos"}' >> SHA2-256SUMS
277 sha256sum artifact/yt-dlp_macos.zip | awk '{print $1 " yt-dlp_macos.zip"}' >> SHA2-256SUMS
278 sha256sum artifact/yt-dlp_macos_legacy | awk '{print $1 " yt-dlp_macos_legacy"}' >> SHA2-256SUMS
279 sha256sum artifact/dist/yt-dlp_linux | awk '{print $1 " yt-dlp_linux"}' >> SHA2-256SUMS
280 sha256sum artifact/dist/yt-dlp_linux.zip | awk '{print $1 " yt-dlp_linux.zip"}' >> SHA2-256SUMS
281 sha512sum artifact/yt-dlp | awk '{print $1 " yt-dlp"}' >> SHA2-512SUMS
282 sha512sum artifact/yt-dlp.tar.gz | awk '{print $1 " yt-dlp.tar.gz"}' >> SHA2-512SUMS
283 sha512sum artifact/yt-dlp.exe | awk '{print $1 " yt-dlp.exe"}' >> SHA2-512SUMS
284 sha512sum artifact/yt-dlp_win.zip | awk '{print $1 " yt-dlp_win.zip"}' >> SHA2-512SUMS
285 sha512sum artifact/yt-dlp_min.exe | awk '{print $1 " yt-dlp_min.exe"}' >> SHA2-512SUMS
286 sha512sum artifact/yt-dlp_x86.exe | awk '{print $1 " yt-dlp_x86.exe"}' >> SHA2-512SUMS
287 sha512sum artifact/yt-dlp_macos | awk '{print $1 " yt-dlp_macos"}' >> SHA2-512SUMS
288 sha512sum artifact/yt-dlp_macos.zip | awk '{print $1 " yt-dlp_macos.zip"}' >> SHA2-512SUMS
289 sha512sum artifact/yt-dlp_macos_legacy | awk '{print $1 " yt-dlp_macos_legacy"}' >> SHA2-512SUMS
290 sha512sum artifact/dist/yt-dlp_linux | awk '{print $1 " yt-dlp_linux"}' >> SHA2-512SUMS
291 sha512sum artifact/dist/yt-dlp_linux.zip | awk '{print $1 " yt-dlp_linux.zip"}' >> SHA2-512SUMS
293 - name: Publish Release
294 uses: yt-dlp/action-gh-release@v1
296 tag_name: ${{ needs.prepare.outputs.ytdlp_version }}
297 name: yt-dlp ${{ needs.prepare.outputs.ytdlp_version }}
298 target_commitish: ${{ needs.prepare.outputs.head_sha }}
300 #### [A description of the various files]((https://github.com/yt-dlp/yt-dlp#release-files)) are in the README
303 <details open><summary><h3>Changelog</summary>
314 artifact/yt-dlp.tar.gz
316 artifact/yt-dlp_win.zip
317 artifact/yt-dlp_min.exe
318 artifact/yt-dlp_x86.exe
319 artifact/yt-dlp_macos
320 artifact/yt-dlp_macos.zip
321 artifact/yt-dlp_macos_legacy
322 artifact/dist/yt-dlp_linux
323 artifact/dist/yt-dlp_linux.zip