]>
Commit | Line | Data |
---|---|---|
915f2a92 | 1 | name: Build |
75b725a7 | 2 | on: workflow_dispatch |
915f2a92 U |
3 | |
4 | jobs: | |
b5899f4f | 5 | create_release: |
915f2a92 | 6 | runs-on: ubuntu-latest |
915f2a92 | 7 | outputs: |
75b725a7 | 8 | version_suffix: ${{ steps.version_suffix.outputs.version_suffix }} |
7a5c1cfe | 9 | ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }} |
915f2a92 | 10 | upload_url: ${{ steps.create_release.outputs.upload_url }} |
915f2a92 U |
11 | steps: |
12 | - uses: actions/checkout@v2 | |
4c88ff87 | 13 | with: |
14 | fetch-depth: 0 | |
b5899f4f | 15 | - uses: actions/setup-python@v2 |
915f2a92 | 16 | with: |
b5899f4f | 17 | python-version: '3.10' |
18 | ||
75b725a7 | 19 | - name: Set version suffix |
20 | id: version_suffix | |
21 | env: | |
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") | |
915f2a92 U |
25 | - name: Bump version |
26 | id: bump_version | |
4c88ff87 | 27 | run: | |
75b725a7 | 28 | python devscripts/update-version.py ${{ steps.version_suffix.outputs.version_suffix }} |
4c88ff87 | 29 | make issuetemplates |
b5899f4f | 30 | |
75b725a7 | 31 | - name: Push to release |
4c88ff87 | 32 | run: | |
75b725a7 | 33 | git config --global user.name github-actions |
34 | git config --global user.email github-actions@example.com | |
4c88ff87 | 35 | git add -u |
b5899f4f | 36 | git commit -m "[version] update" -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all :ci run dl" |
75b725a7 | 37 | git push origin --force ${{ github.event.ref }}:release |
4c88ff87 | 38 | echo ::set-output name=head_sha::$(git rev-parse HEAD) |
75b725a7 | 39 | - name: Update master |
75b725a7 | 40 | env: |
41 | PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }} | |
42 | if: "env.PUSH_VERSION_COMMIT != ''" | |
43 | run: git push origin ${{ github.event.ref }} | |
4c88ff87 | 44 | - name: Get Changelog |
4c88ff87 | 45 | run: | |
64fa820c | 46 | changelog=$(grep -oPz '(?s)(?<=### ${{ steps.bump_version.outputs.ytdlp_version }}\n{2}).+?(?=\n{2,3}###)' Changelog.md) || true |
4c88ff87 | 47 | echo "changelog<<EOF" >> $GITHUB_ENV |
48 | echo "$changelog" >> $GITHUB_ENV | |
49 | echo "EOF" >> $GITHUB_ENV | |
6e21fdd2 | 50 | |
915f2a92 U |
51 | - name: Create Release |
52 | id: create_release | |
53 | uses: actions/create-release@v1 | |
54 | env: | |
55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
56 | with: | |
7a5c1cfe P |
57 | tag_name: ${{ steps.bump_version.outputs.ytdlp_version }} |
58 | release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlp_version }} | |
a804f6d8 | 59 | commitish: ${{ steps.push_release.outputs.head_sha }} |
915f2a92 | 60 | body: | |
0930b11f | 61 | #### [A description of the various files]((https://github.com/yt-dlp/yt-dlp#release-files)) are in the README |
49a57e70 | 62 | |
63 | --- | |
64 | ||
0930b11f | 65 | ### Changelog: |
66 | ${{ env.changelog }} | |
915f2a92 U |
67 | draft: false |
68 | prerelease: false | |
b5899f4f | 69 | |
70 | ||
71 | build_unix: | |
72 | needs: create_release | |
73 | runs-on: ubuntu-latest | |
74 | outputs: | |
75 | sha256_bin: ${{ steps.get_sha.outputs.sha256_bin }} | |
76 | sha512_bin: ${{ steps.get_sha.outputs.sha512_bin }} | |
77 | sha256_tar: ${{ steps.get_sha.outputs.sha256_tar }} | |
78 | sha512_tar: ${{ steps.get_sha.outputs.sha512_tar }} | |
79 | sha256_unix_zip: ${{ steps.get_sha.outputs.sha256_unix_zip }} | |
80 | sha512_unix_zip: ${{ steps.get_sha.outputs.sha512_unix_zip }} | |
81 | ||
82 | steps: | |
83 | - uses: actions/checkout@v2 | |
84 | - uses: actions/setup-python@v2 | |
85 | with: | |
86 | python-version: '3.10' | |
87 | - name: Install Requirements | |
88 | run: | | |
89 | sudo apt-get -y install zip pandoc man | |
90 | python -m pip install --upgrade pip setuptools wheel twine | |
91 | python -m pip install Pyinstaller -r requirements.txt | |
92 | ||
93 | - name: Prepare | |
94 | run: | | |
95 | python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }} | |
96 | python devscripts/make_lazy_extractors.py | |
97 | - name: Build UNIX executables | |
98 | run: | | |
99 | make all tar | |
100 | - name: Get SHA2-SUMS | |
101 | id: get_sha | |
102 | run: | | |
103 | echo "::set-output name=sha256_bin::$(sha256sum yt-dlp | awk '{print $1}')" | |
104 | echo "::set-output name=sha512_bin::$(sha512sum yt-dlp | awk '{print $1}')" | |
105 | echo "::set-output name=sha256_tar::$(sha256sum yt-dlp.tar.gz | awk '{print $1}')" | |
106 | echo "::set-output name=sha512_tar::$(sha512sum yt-dlp.tar.gz | awk '{print $1}')" | |
107 | ||
108 | - name: Upload zip binary | |
915f2a92 U |
109 | uses: actions/upload-release-asset@v1 |
110 | env: | |
111 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
112 | with: | |
b5899f4f | 113 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
7a5c1cfe P |
114 | asset_path: ./yt-dlp |
115 | asset_name: yt-dlp | |
915f2a92 | 116 | asset_content_type: application/octet-stream |
ed64ce59 | 117 | - name: Upload Source tar |
118 | uses: actions/upload-release-asset@v1 | |
119 | env: | |
120 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
121 | with: | |
b5899f4f | 122 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
ed64ce59 | 123 | asset_path: ./yt-dlp.tar.gz |
124 | asset_name: yt-dlp.tar.gz | |
125 | asset_content_type: application/gzip | |
915f2a92 | 126 | |
b5899f4f | 127 | - name: Build and publish on PyPi |
128 | env: | |
129 | TWINE_USERNAME: __token__ | |
130 | TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
131 | if: "env.TWINE_PASSWORD != ''" | |
132 | run: | | |
133 | rm -rf dist/* | |
134 | python setup.py sdist bdist_wheel | |
135 | twine upload dist/* | |
136 | ||
137 | - name: Install SSH private key for Homebrew | |
138 | env: | |
139 | BREW_TOKEN: ${{ secrets.BREW_TOKEN }} | |
140 | if: "env.BREW_TOKEN != ''" | |
141 | uses: yt-dlp/ssh-agent@v0.5.3 | |
142 | with: | |
143 | ssh-private-key: ${{ env.BREW_TOKEN }} | |
144 | - name: Update Homebrew Formulae | |
145 | env: | |
146 | BREW_TOKEN: ${{ secrets.BREW_TOKEN }} | |
147 | if: "env.BREW_TOKEN != ''" | |
148 | run: | | |
149 | git clone git@github.com:yt-dlp/homebrew-taps taps/ | |
150 | python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ steps.bump_version.outputs.ytdlp_version }}" | |
151 | git -C taps/ config user.name github-actions | |
152 | git -C taps/ config user.email github-actions@example.com | |
153 | git -C taps/ commit -am 'yt-dlp: ${{ steps.bump_version.outputs.ytdlp_version }}' | |
154 | git -C taps/ push | |
155 | ||
156 | ||
0e5927ee R |
157 | build_macos: |
158 | runs-on: macos-11 | |
b5899f4f | 159 | needs: create_release |
0e5927ee | 160 | outputs: |
b5899f4f | 161 | sha256_macos: ${{ steps.get_sha.outputs.sha256_macos }} |
162 | sha512_macos: ${{ steps.get_sha.outputs.sha512_macos }} | |
163 | sha256_macos_zip: ${{ steps.get_sha.outputs.sha256_macos_zip }} | |
164 | sha512_macos_zip: ${{ steps.get_sha.outputs.sha512_macos_zip }} | |
0e5927ee R |
165 | |
166 | steps: | |
167 | - uses: actions/checkout@v2 | |
b5899f4f | 168 | # NB: In order to create a universal2 application, the version of python3 in /usr/bin has to be used |
0e5927ee R |
169 | - name: Install Requirements |
170 | run: | | |
171 | brew install coreutils | |
b5899f4f | 172 | /usr/bin/python3 -m pip install -U --user pip Pyinstaller -r requirements.txt |
173 | ||
174 | - name: Prepare | |
175 | run: | | |
176 | /usr/bin/python3 devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }} | |
177 | /usr/bin/python3 devscripts/make_lazy_extractors.py | |
178 | - name: Build | |
179 | run: | | |
180 | /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir | |
181 | (cd ./dist/yt-dlp_macos && zip -r ../yt-dlp_macos.zip .) | |
182 | /usr/bin/python3 pyinst.py --target-architecture universal2 | |
183 | - name: Get SHA2-SUMS | |
184 | id: get_sha | |
185 | run: | | |
186 | echo "::set-output name=sha256_macos::$(sha256sum dist/yt-dlp_macos | awk '{print $1}')" | |
187 | echo "::set-output name=sha512_macos::$(sha512sum dist/yt-dlp_macos | awk '{print $1}')" | |
188 | echo "::set-output name=sha256_macos_zip::$(sha256sum dist/yt-dlp_macos.zip | awk '{print $1}')" | |
189 | echo "::set-output name=sha512_macos_zip::$(sha512sum dist/yt-dlp_macos.zip | awk '{print $1}')" | |
190 | ||
191 | - name: Upload standalone binary | |
0e5927ee R |
192 | uses: actions/upload-release-asset@v1 |
193 | env: | |
194 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
195 | with: | |
b5899f4f | 196 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
0e5927ee R |
197 | asset_path: ./dist/yt-dlp_macos |
198 | asset_name: yt-dlp_macos | |
199 | asset_content_type: application/octet-stream | |
b5899f4f | 200 | - name: Upload onedir binary |
0e5927ee R |
201 | uses: actions/upload-release-asset@v1 |
202 | env: | |
203 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
204 | with: | |
b5899f4f | 205 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
0e5927ee R |
206 | asset_path: ./dist/yt-dlp_macos.zip |
207 | asset_name: yt-dlp_macos.zip | |
208 | asset_content_type: application/zip | |
b5899f4f | 209 | |
0e5927ee | 210 | |
7e8772bf | 211 | build_windows: |
915f2a92 | 212 | runs-on: windows-latest |
b5899f4f | 213 | needs: create_release |
47930b73 | 214 | outputs: |
b5899f4f | 215 | sha256_win: ${{ steps.get_sha.outputs.sha256_win }} |
216 | sha512_win: ${{ steps.get_sha.outputs.sha512_win }} | |
217 | sha256_py2exe: ${{ steps.get_sha.outputs.sha256_py2exe }} | |
218 | sha512_py2exe: ${{ steps.get_sha.outputs.sha512_py2exe }} | |
219 | sha256_win_zip: ${{ steps.get_sha.outputs.sha256_win_zip }} | |
220 | sha512_win_zip: ${{ steps.get_sha.outputs.sha512_win_zip }} | |
47930b73 | 221 | |
915f2a92 U |
222 | steps: |
223 | - uses: actions/checkout@v2 | |
b5899f4f | 224 | - uses: actions/setup-python@v2 |
225 | with: # 3.8 is used for Win7 support | |
da8fb75d | 226 | python-version: '3.8' |
915f2a92 | 227 | - name: Install Requirements |
b5899f4f | 228 | run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds |
386cdfdb | 229 | python -m pip install --upgrade pip setuptools wheel py2exe |
b46ccbc6 | 230 | pip install "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt |
b5899f4f | 231 | |
232 | - name: Prepare | |
233 | run: | | |
234 | python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }} | |
235 | python devscripts/make_lazy_extractors.py | |
236 | - name: Build | |
237 | run: | | |
238 | python setup.py py2exe | |
239 | Move-Item ./dist/yt-dlp.exe ./dist/yt-dlp_min.exe | |
240 | python pyinst.py | |
241 | python pyinst.py --onedir | |
242 | Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip | |
243 | - name: Get SHA2-SUMS | |
244 | id: get_sha | |
245 | run: | | |
246 | echo "::set-output name=sha256_py2exe::$((Get-FileHash dist\yt-dlp_min.exe -Algorithm SHA256).Hash.ToLower())" | |
247 | echo "::set-output name=sha512_py2exe::$((Get-FileHash dist\yt-dlp_min.exe -Algorithm SHA512).Hash.ToLower())" | |
248 | echo "::set-output name=sha256_win::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA256).Hash.ToLower())" | |
249 | echo "::set-output name=sha512_win::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA512).Hash.ToLower())" | |
250 | echo "::set-output name=sha256_win_zip::$((Get-FileHash dist\yt-dlp_win.zip -Algorithm SHA256).Hash.ToLower())" | |
251 | echo "::set-output name=sha512_win_zip::$((Get-FileHash dist\yt-dlp_win.zip -Algorithm SHA512).Hash.ToLower())" | |
252 | ||
253 | - name: Upload py2exe binary | |
254 | uses: actions/upload-release-asset@v1 | |
75b725a7 | 255 | env: |
b5899f4f | 256 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
257 | with: | |
258 | upload_url: ${{ needs.create_release.outputs.upload_url }} | |
259 | asset_path: ./dist/yt-dlp_min.exe | |
260 | asset_name: yt-dlp_min.exe | |
261 | asset_content_type: application/vnd.microsoft.portable-executable | |
262 | - name: Upload standalone binary | |
915f2a92 U |
263 | uses: actions/upload-release-asset@v1 |
264 | env: | |
265 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
266 | with: | |
b5899f4f | 267 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
7a5c1cfe P |
268 | asset_path: ./dist/yt-dlp.exe |
269 | asset_name: yt-dlp.exe | |
98918847 | 270 | asset_content_type: application/vnd.microsoft.portable-executable |
b5899f4f | 271 | - name: Upload onedir binary |
4c88ff87 | 272 | uses: actions/upload-release-asset@v1 |
273 | env: | |
274 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
275 | with: | |
b5899f4f | 276 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
0e5927ee R |
277 | asset_path: ./dist/yt-dlp_win.zip |
278 | asset_name: yt-dlp_win.zip | |
4c88ff87 | 279 | asset_content_type: application/zip |
b5899f4f | 280 | |
386cdfdb | 281 | |
915f2a92 | 282 | build_windows32: |
915f2a92 | 283 | runs-on: windows-latest |
b5899f4f | 284 | needs: create_release |
47930b73 | 285 | outputs: |
b5899f4f | 286 | sha256_win32: ${{ steps.get_sha.outputs.sha256_win32 }} |
287 | sha512_win32: ${{ steps.get_sha.outputs.sha512_win32 }} | |
47930b73 | 288 | |
915f2a92 U |
289 | steps: |
290 | - uses: actions/checkout@v2 | |
b5899f4f | 291 | - uses: actions/setup-python@v2 |
292 | with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390 | |
0181adef | 293 | python-version: '3.7' |
915f2a92 | 294 | architecture: 'x86' |
0181adef | 295 | - name: Install Requirements |
0e5927ee R |
296 | run: | |
297 | python -m pip install --upgrade pip setuptools wheel | |
b46ccbc6 | 298 | pip install "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt |
b5899f4f | 299 | |
300 | - name: Prepare | |
301 | run: | | |
302 | python devscripts/update-version.py ${{ needs.create_release.outputs.version_suffix }} | |
303 | python devscripts/make_lazy_extractors.py | |
304 | - name: Build | |
305 | run: | | |
306 | python pyinst.py | |
307 | - name: Get SHA2-SUMS | |
308 | id: get_sha | |
309 | run: | | |
310 | echo "::set-output name=sha256_win32::$((Get-FileHash dist\yt-dlp_x86.exe -Algorithm SHA256).Hash.ToLower())" | |
311 | echo "::set-output name=sha512_win32::$((Get-FileHash dist\yt-dlp_x86.exe -Algorithm SHA512).Hash.ToLower())" | |
312 | ||
313 | - name: Upload standalone binary | |
915f2a92 U |
314 | uses: actions/upload-release-asset@v1 |
315 | env: | |
316 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
317 | with: | |
b5899f4f | 318 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
7a5c1cfe P |
319 | asset_path: ./dist/yt-dlp_x86.exe |
320 | asset_name: yt-dlp_x86.exe | |
98918847 | 321 | asset_content_type: application/vnd.microsoft.portable-executable |
b5899f4f | 322 | |
14b17a55 | 323 | |
324 | finish: | |
325 | runs-on: ubuntu-latest | |
b5899f4f | 326 | needs: [create_release, build_unix, build_windows, build_windows32, build_macos] |
14b17a55 | 327 | |
328 | steps: | |
b5899f4f | 329 | - name: Make SHA2-SUMS files |
915f2a92 | 330 | run: | |
b5899f4f | 331 | echo "${{ needs.build_unix.outputs.sha256_bin }} yt-dlp" >> SHA2-256SUMS |
332 | echo "${{ needs.build_unix.outputs.sha256_tar }} yt-dlp.tar.gz" >> SHA2-256SUMS | |
333 | echo "${{ needs.build_windows.outputs.sha256_win }} yt-dlp.exe" >> SHA2-256SUMS | |
334 | echo "${{ needs.build_windows.outputs.sha256_py2exe }} yt-dlp_min.exe" >> SHA2-256SUMS | |
335 | echo "${{ needs.build_windows32.outputs.sha256_win32 }} yt-dlp_x86.exe" >> SHA2-256SUMS | |
336 | echo "${{ needs.build_windows.outputs.sha256_win_zip }} yt-dlp_win.zip" >> SHA2-256SUMS | |
337 | echo "${{ needs.build_macos.outputs.sha256_macos }} yt-dlp_macos" >> SHA2-256SUMS | |
338 | echo "${{ needs.build_macos.outputs.sha256_macos_zip }} yt-dlp_macos.zip" >> SHA2-256SUMS | |
339 | echo "${{ needs.build_unix.outputs.sha512_bin }} yt-dlp" >> SHA2-512SUMS | |
340 | echo "${{ needs.build_unix.outputs.sha512_tar }} yt-dlp.tar.gz" >> SHA2-512SUMS | |
341 | echo "${{ needs.build_windows.outputs.sha512_win }} yt-dlp.exe" >> SHA2-512SUMS | |
342 | echo "${{ needs.build_windows.outputs.sha512_py2exe }} yt-dlp_min.exe" >> SHA2-512SUMS | |
343 | echo "${{ needs.build_windows32.outputs.sha512_win32 }} yt-dlp_x86.exe" >> SHA2-512SUMS | |
344 | echo "${{ needs.build_windows.outputs.sha512_win_zip }} yt-dlp_win.zip" >> SHA2-512SUMS | |
345 | echo "${{ needs.build_macos.outputs.sha512_macos }} yt-dlp_macos" >> SHA2-512SUMS | |
346 | echo "${{ needs.build_macos.outputs.sha512_macos_zip }} yt-dlp_macos.zip" >> SHA2-512SUMS | |
347 | ||
348 | - name: Upload SHA2-256SUMS file | |
da6403d3 TOH |
349 | uses: actions/upload-release-asset@v1 |
350 | env: | |
351 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
352 | with: | |
b5899f4f | 353 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
da6403d3 TOH |
354 | asset_path: ./SHA2-256SUMS |
355 | asset_name: SHA2-256SUMS | |
356 | asset_content_type: text/plain | |
b5899f4f | 357 | - name: Upload SHA2-512SUMS file |
beb982be NA |
358 | uses: actions/upload-release-asset@v1 |
359 | env: | |
360 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
361 | with: | |
b5899f4f | 362 | upload_url: ${{ needs.create_release.outputs.upload_url }} |
beb982be NA |
363 | asset_path: ./SHA2-512SUMS |
364 | asset_name: SHA2-512SUMS | |
365 | asset_content_type: text/plain |