8 version_suffix: ${{ steps.version_suffix.outputs.version_suffix }}
9 ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }}
10 upload_url: ${{ steps.create_release.outputs.upload_url }}
12 - uses: actions/checkout@v2
15 - uses: actions/setup-python@v2
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 ::set-output name=version_suffix::$(date -u +"%H%M%S")
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 ::set-output name=head_sha::$(git rev-parse HEAD)
42 PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }}
43 if: "env.PUSH_VERSION_COMMIT != ''"
44 run: git push origin ${{ github.event.ref }}
47 changelog=$(grep -oPz '(?s)(?<=### ${{ steps.bump_version.outputs.ytdlp_version }}\n{2}).+?(?=\n{2,3}###)' Changelog.md) || true
48 echo "changelog<<EOF" >> $GITHUB_ENV
49 echo "$changelog" >> $GITHUB_ENV
50 echo "EOF" >> $GITHUB_ENV
52 - name: Create Release
54 uses: actions/create-release@v1
56 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 tag_name: ${{ steps.bump_version.outputs.ytdlp_version }}
59 release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlp_version }}
60 commitish: ${{ steps.push_release.outputs.head_sha }}
62 #### [A description of the various files]((https://github.com/yt-dlp/yt-dlp#release-files)) are in the README
74 runs-on: ubuntu-18.04 # Standalone executable should be built on minimum supported OS
76 sha256_bin: ${{ steps.get_sha.outputs.sha256_bin }}
77 sha512_bin: ${{ steps.get_sha.outputs.sha512_bin }}
78 sha256_tar: ${{ steps.get_sha.outputs.sha256_tar }}
79 sha512_tar: ${{ steps.get_sha.outputs.sha512_tar }}
80 sha256_linux: ${{ steps.get_sha.outputs.sha256_linux }}
81 sha512_linux: ${{ steps.get_sha.outputs.sha512_linux }}
82 sha256_linux_zip: ${{ steps.get_sha.outputs.sha256_linux_zip }}
83 sha512_linux_zip: ${{ steps.get_sha.outputs.sha512_linux_zip }}
86 - uses: actions/checkout@v2
87 - uses: actions/setup-python@v2
89 python-version: '3.10'
90 - name: Install Requirements
92 sudo apt-get -y install zip pandoc man
93 python -m pip install --upgrade pip setuptools wheel twine
94 python -m pip install Pyinstaller -r requirements.txt
98 python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }}
99 python devscripts/make_lazy_extractors.py
100 - name: Build Unix executables
103 python pyinst.py --onedir
104 (cd ./dist/yt-dlp_linux && zip -r ../yt-dlp_linux.zip .)
106 - name: Get SHA2-SUMS
109 echo "::set-output name=sha256_bin::$(sha256sum yt-dlp | awk '{print $1}')"
110 echo "::set-output name=sha512_bin::$(sha512sum yt-dlp | awk '{print $1}')"
111 echo "::set-output name=sha256_tar::$(sha256sum yt-dlp.tar.gz | awk '{print $1}')"
112 echo "::set-output name=sha512_tar::$(sha512sum yt-dlp.tar.gz | awk '{print $1}')"
113 echo "::set-output name=sha256_linux::$(sha256sum dist/yt-dlp_linux | awk '{print $1}')"
114 echo "::set-output name=sha512_linux::$(sha512sum dist/yt-dlp_linux | awk '{print $1}')"
115 echo "::set-output name=sha256_linux_zip::$(sha256sum dist/yt-dlp_linux.zip | awk '{print $1}')"
116 echo "::set-output name=sha512_linux_zip::$(sha512sum dist/yt-dlp_linux.zip | awk '{print $1}')"
118 - name: Upload zip binary
119 uses: actions/upload-release-asset@v1
121 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123 upload_url: ${{ needs.create_release.outputs.upload_url }}
126 asset_content_type: application/octet-stream
127 - name: Upload Source tar
128 uses: actions/upload-release-asset@v1
130 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132 upload_url: ${{ needs.create_release.outputs.upload_url }}
133 asset_path: ./yt-dlp.tar.gz
134 asset_name: yt-dlp.tar.gz
135 asset_content_type: application/gzip
136 - name: Upload standalone binary
137 uses: actions/upload-release-asset@v1
139 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141 upload_url: ${{ needs.create_release.outputs.upload_url }}
142 asset_path: ./dist/yt-dlp_linux
143 asset_name: yt-dlp_linux
144 asset_content_type: application/octet-stream
145 - name: Upload onedir binary
146 uses: actions/upload-release-asset@v1
148 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150 upload_url: ${{ needs.create_release.outputs.upload_url }}
151 asset_path: ./dist/yt-dlp_linux.zip
152 asset_name: yt-dlp_linux.zip
153 asset_content_type: application/zip
155 - name: Build and publish on PyPi
157 TWINE_USERNAME: __token__
158 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
159 if: "env.TWINE_PASSWORD != ''"
162 python setup.py sdist bdist_wheel
165 - name: Install SSH private key for Homebrew
167 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
168 if: "env.BREW_TOKEN != ''"
169 uses: yt-dlp/ssh-agent@v0.5.3
171 ssh-private-key: ${{ env.BREW_TOKEN }}
172 - name: Update Homebrew Formulae
174 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
175 if: "env.BREW_TOKEN != ''"
177 git clone git@github.com:yt-dlp/homebrew-taps taps/
178 python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ needs.create_release.outputs.ytdlp_version }}"
179 git -C taps/ config user.name github-actions
180 git -C taps/ config user.email github-actions@example.com
181 git -C taps/ commit -am 'yt-dlp: ${{ needs.create_release.outputs.ytdlp_version }}'
187 needs: create_release
189 sha256_macos: ${{ steps.get_sha.outputs.sha256_macos }}
190 sha512_macos: ${{ steps.get_sha.outputs.sha512_macos }}
191 sha256_macos_zip: ${{ steps.get_sha.outputs.sha256_macos_zip }}
192 sha512_macos_zip: ${{ steps.get_sha.outputs.sha512_macos_zip }}
195 - uses: actions/checkout@v2
196 # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used
197 - name: Install Requirements
199 brew install coreutils
200 /usr/bin/python3 -m pip install -U --user pip Pyinstaller -r requirements.txt
204 /usr/bin/python3 devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }}
205 /usr/bin/python3 devscripts/make_lazy_extractors.py
208 /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir
209 (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .)
210 /usr/bin/python3 pyinst.py --target-architecture universal2
211 - name: Get SHA2-SUMS
214 echo "::set-output name=sha256_macos::$(sha256sum dist/yt-dlp_macos | awk '{print $1}')"
215 echo "::set-output name=sha512_macos::$(sha512sum dist/yt-dlp_macos | awk '{print $1}')"
216 echo "::set-output name=sha256_macos_zip::$(sha256sum dist/yt-dlp_macos.zip | awk '{print $1}')"
217 echo "::set-output name=sha512_macos_zip::$(sha512sum dist/yt-dlp_macos.zip | awk '{print $1}')"
219 - name: Upload standalone binary
220 uses: actions/upload-release-asset@v1
222 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224 upload_url: ${{ needs.create_release.outputs.upload_url }}
225 asset_path: ./dist/yt-dlp_macos
226 asset_name: yt-dlp_macos
227 asset_content_type: application/octet-stream
228 - name: Upload onedir binary
229 uses: actions/upload-release-asset@v1
231 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
233 upload_url: ${{ needs.create_release.outputs.upload_url }}
234 asset_path: ./dist/yt-dlp_macos.zip
235 asset_name: yt-dlp_macos.zip
236 asset_content_type: application/zip
240 runs-on: windows-latest
241 needs: create_release
243 sha256_win: ${{ steps.get_sha.outputs.sha256_win }}
244 sha512_win: ${{ steps.get_sha.outputs.sha512_win }}
245 sha256_py2exe: ${{ steps.get_sha.outputs.sha256_py2exe }}
246 sha512_py2exe: ${{ steps.get_sha.outputs.sha512_py2exe }}
247 sha256_win_zip: ${{ steps.get_sha.outputs.sha256_win_zip }}
248 sha512_win_zip: ${{ steps.get_sha.outputs.sha512_win_zip }}
251 - uses: actions/checkout@v2
252 - uses: actions/setup-python@v2
253 with: # 3.8 is used for Win7 support
254 python-version: '3.8'
255 - name: Install Requirements
256 run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
257 python -m pip install --upgrade pip setuptools wheel py2exe
258 pip install "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt
262 python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }}
263 python devscripts/make_lazy_extractors.py
266 python setup.py py2exe
267 Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe
269 python pyinst.py --onedir
270 Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip
271 - name: Get SHA2-SUMS
274 echo "::set-output name=sha256_py2exe::$((Get-FileHash dist\yt-dlp_min.exe -Algorithm SHA256).Hash.ToLower())"
275 echo "::set-output name=sha512_py2exe::$((Get-FileHash dist\yt-dlp_min.exe -Algorithm SHA512).Hash.ToLower())"
276 echo "::set-output name=sha256_win::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA256).Hash.ToLower())"
277 echo "::set-output name=sha512_win::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA512).Hash.ToLower())"
278 echo "::set-output name=sha256_win_zip::$((Get-FileHash dist\yt-dlp_win.zip -Algorithm SHA256).Hash.ToLower())"
279 echo "::set-output name=sha512_win_zip::$((Get-FileHash dist\yt-dlp_win.zip -Algorithm SHA512).Hash.ToLower())"
281 - name: Upload py2exe binary
282 uses: actions/upload-release-asset@v1
284 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
286 upload_url: ${{ needs.create_release.outputs.upload_url }}
287 asset_path: ./dist/yt-dlp_min.exe
288 asset_name: yt-dlp_min.exe
289 asset_content_type: application/vnd.microsoft.portable-executable
290 - name: Upload standalone binary
291 uses: actions/upload-release-asset@v1
293 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
295 upload_url: ${{ needs.create_release.outputs.upload_url }}
296 asset_path: ./dist/yt-dlp.exe
297 asset_name: yt-dlp.exe
298 asset_content_type: application/vnd.microsoft.portable-executable
299 - name: Upload onedir binary
300 uses: actions/upload-release-asset@v1
302 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
304 upload_url: ${{ needs.create_release.outputs.upload_url }}
305 asset_path: ./dist/yt-dlp_win.zip
306 asset_name: yt-dlp_win.zip
307 asset_content_type: application/zip
311 runs-on: windows-latest
312 needs: create_release
314 sha256_win32: ${{ steps.get_sha.outputs.sha256_win32 }}
315 sha512_win32: ${{ steps.get_sha.outputs.sha512_win32 }}
318 - uses: actions/checkout@v2
319 - uses: actions/setup-python@v2
320 with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390
321 python-version: '3.7'
323 - name: Install Requirements
325 python -m pip install --upgrade pip setuptools wheel
326 pip install "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt
330 python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }}
331 python devscripts/make_lazy_extractors.py
335 - name: Get SHA2-SUMS
338 echo "::set-output name=sha256_win32::$((Get-FileHash dist\yt-dlp_x86.exe -Algorithm SHA256).Hash.ToLower())"
339 echo "::set-output name=sha512_win32::$((Get-FileHash dist\yt-dlp_x86.exe -Algorithm SHA512).Hash.ToLower())"
341 - name: Upload standalone binary
342 uses: actions/upload-release-asset@v1
344 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346 upload_url: ${{ needs.create_release.outputs.upload_url }}
347 asset_path: ./dist/yt-dlp_x86.exe
348 asset_name: yt-dlp_x86.exe
349 asset_content_type: application/vnd.microsoft.portable-executable
353 runs-on: ubuntu-latest
354 needs: [create_release, build_unix, build_windows, build_windows32, build_macos]
357 - name: Make SHA2-SUMS files
359 echo "${{ needs.build_unix.outputs.sha256_bin }} yt-dlp" >> SHA2-256SUMS
360 echo "${{ needs.build_unix.outputs.sha256_tar }} yt-dlp.tar.gz" >> SHA2-256SUMS
361 echo "${{ needs.build_unix.outputs.sha256_linux }} yt-dlp_linux" >> SHA2-256SUMS
362 echo "${{ needs.build_unix.outputs.sha256_linux_zip }} yt-dlp_linux.zip" >> SHA2-256SUMS
363 echo "${{ needs.build_windows.outputs.sha256_win }} yt-dlp.exe" >> SHA2-256SUMS
364 echo "${{ needs.build_windows.outputs.sha256_py2exe }} yt-dlp_min.exe" >> SHA2-256SUMS
365 echo "${{ needs.build_windows32.outputs.sha256_win32 }} yt-dlp_x86.exe" >> SHA2-256SUMS
366 echo "${{ needs.build_windows.outputs.sha256_win_zip }} yt-dlp_win.zip" >> SHA2-256SUMS
367 echo "${{ needs.build_macos.outputs.sha256_macos }} yt-dlp_macos" >> SHA2-256SUMS
368 echo "${{ needs.build_macos.outputs.sha256_macos_zip }} yt-dlp_macos.zip" >> SHA2-256SUMS
369 echo "${{ needs.build_unix.outputs.sha512_bin }} yt-dlp" >> SHA2-512SUMS
370 echo "${{ needs.build_unix.outputs.sha512_tar }} yt-dlp.tar.gz" >> SHA2-512SUMS
371 echo "${{ needs.build_unix.outputs.sha512_linux }} yt-dlp_linux" >> SHA2-512SUMS
372 echo "${{ needs.build_unix.outputs.sha512_linux_zip }} yt-dlp_linux.zip" >> SHA2-512SUMS
373 echo "${{ needs.build_windows.outputs.sha512_win }} yt-dlp.exe" >> SHA2-512SUMS
374 echo "${{ needs.build_windows.outputs.sha512_py2exe }} yt-dlp_min.exe" >> SHA2-512SUMS
375 echo "${{ needs.build_windows32.outputs.sha512_win32 }} yt-dlp_x86.exe" >> SHA2-512SUMS
376 echo "${{ needs.build_windows.outputs.sha512_win_zip }} yt-dlp_win.zip" >> SHA2-512SUMS
377 echo "${{ needs.build_macos.outputs.sha512_macos }} yt-dlp_macos" >> SHA2-512SUMS
378 echo "${{ needs.build_macos.outputs.sha512_macos_zip }} yt-dlp_macos.zip" >> SHA2-512SUMS
380 - name: Upload SHA2-256SUMS file
381 uses: actions/upload-release-asset@v1
383 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
385 upload_url: ${{ needs.create_release.outputs.upload_url }}
386 asset_path: ./SHA2-256SUMS
387 asset_name: SHA2-256SUMS
388 asset_content_type: text/plain
389 - name: Upload SHA2-512SUMS file
390 uses: actions/upload-release-asset@v1
392 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
394 upload_url: ${{ needs.create_release.outputs.upload_url }}
395 asset_path: ./SHA2-512SUMS
396 asset_name: SHA2-512SUMS
397 asset_content_type: text/plain