]> jfr.im git - yt-dlp.git/blame - .github/workflows/build.yml
Remove support for obsolete python versions
[yt-dlp.git] / .github / workflows / build.yml
CommitLineData
915f2a92
U
1name: Build
2
3on:
4 push:
5 branches:
6 - release
7
8jobs:
93721ed0 9 build_unix:
915f2a92
U
10 runs-on: ubuntu-latest
11
12 outputs:
7a5c1cfe 13 ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }}
915f2a92
U
14 upload_url: ${{ steps.create_release.outputs.upload_url }}
15 sha2_unix: ${{ steps.sha2_file.outputs.sha2_unix }}
16
17 steps:
18 - uses: actions/checkout@v2
19 - name: Set up Python
20 uses: actions/setup-python@v2
21 with:
764876a0 22 python-version: '3.8'
915f2a92
U
23 - name: Install packages
24 run: sudo apt-get -y install zip pandoc man
25 - name: Bump version
26 id: bump_version
e38df8f9 27 run: python devscripts/update-version.py
28 - name: Print version
7a5c1cfe 29 run: echo "${{ steps.bump_version.outputs.ytdlp_version }}"
915f2a92
U
30 - name: Run Make
31 run: make
32 - name: Create Release
33 id: create_release
34 uses: actions/create-release@v1
35 env:
36 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 with:
7a5c1cfe
P
38 tag_name: ${{ steps.bump_version.outputs.ytdlp_version }}
39 release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlp_version }}
915f2a92
U
40 body: |
41 Changelog:
42 PLACEHOLDER
43 draft: false
44 prerelease: false
7a5c1cfe 45 - name: Upload yt-dlp Unix binary
14b17a55 46 id: upload-release-asset
915f2a92
U
47 uses: actions/upload-release-asset@v1
48 env:
49 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 with:
51 upload_url: ${{ steps.create_release.outputs.upload_url }}
7a5c1cfe
P
52 asset_path: ./yt-dlp
53 asset_name: yt-dlp
915f2a92 54 asset_content_type: application/octet-stream
7a5c1cfe 55 - name: Get SHA2-256SUMS for yt-dlp
915f2a92 56 id: sha2_file
7a5c1cfe 57 run: echo "::set-output name=sha2_unix::$(sha256sum yt-dlp | awk '{print $1}')"
7bc877a2 58 - name: Install dependencies for pypi
2a86f3da 59 env:
60 PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
61 if: "env.PYPI_TOKEN != ''"
7bc877a2 62 run: |
63 python -m pip install --upgrade pip
64 pip install setuptools wheel twine
65 - name: Build and publish on pypi
66 env:
67 TWINE_USERNAME: __token__
68 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2a86f3da 69 if: "env.TWINE_PASSWORD != ''"
7bc877a2 70 run: |
71 rm -rf dist/*
72 python setup.py sdist bdist_wheel
73 twine upload dist/*
915f2a92 74
7e8772bf 75 build_windows:
915f2a92 76 runs-on: windows-latest
14b17a55 77 needs: build_unix
915f2a92 78
47930b73 79 outputs:
80 sha2_windows: ${{ steps.sha2_file_win.outputs.sha2_windows }}
81
915f2a92
U
82 steps:
83 - uses: actions/checkout@v2
84 - name: Set up Python
85 uses: actions/setup-python@v2
86 with:
da8fb75d 87 python-version: '3.8'
55e36f03 88 - name: Upgrade pip and enable wheel support
89 run: python -m pip install --upgrade pip setuptools wheel
915f2a92 90 - name: Install Requirements
5d25607a 91 run: pip install pyinstaller mutagen pycryptodome
915f2a92 92 - name: Bump version
e38df8f9 93 id: bump_version
94 run: python devscripts/update-version.py
95 - name: Print version
7a5c1cfe 96 run: echo "${{ steps.bump_version.outputs.ytdlp_version }}"
915f2a92 97 - name: Run PyInstaller Script
b3943b2f 98 run: python pyinst.py 64
7a5c1cfe 99 - name: Upload yt-dlp.exe Windows binary
915f2a92
U
100 id: upload-release-windows
101 uses: actions/upload-release-asset@v1
102 env:
103 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104 with:
105 upload_url: ${{ needs.build_unix.outputs.upload_url }}
7a5c1cfe
P
106 asset_path: ./dist/yt-dlp.exe
107 asset_name: yt-dlp.exe
98918847 108 asset_content_type: application/vnd.microsoft.portable-executable
7a5c1cfe 109 - name: Get SHA2-256SUMS for yt-dlp.exe
915f2a92 110 id: sha2_file_win
7a5c1cfe 111 run: echo "::set-output name=sha2_windows::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA256).Hash.ToLower())"
915f2a92
U
112
113 build_windows32:
915f2a92 114 runs-on: windows-latest
14b17a55 115 needs: [build_unix, build_windows]
915f2a92 116
47930b73 117 outputs:
118 sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }}
119
915f2a92
U
120 steps:
121 - uses: actions/checkout@v2
d052b9a1 122 - name: Set up Python 3.4.4 32-Bit
915f2a92
U
123 uses: actions/setup-python@v2
124 with:
da8fb75d 125 python-version: '3.4.4'
915f2a92 126 architecture: 'x86'
55e36f03 127 - name: Upgrade pip and enable wheel support
128 run: python -m pip install pip==19.1.1 setuptools==43.0.0 wheel==0.33.6
915f2a92 129 - name: Install Requirements for 32 Bit
7237fdc6 130 run: pip install pyinstaller==3.5 mutagen==1.42.0 pycryptodome==3.9.4 pefile==2019.4.18
915f2a92 131 - name: Bump version
e38df8f9 132 id: bump_version
133 run: python devscripts/update-version.py
134 - name: Print version
7a5c1cfe 135 run: echo "${{ steps.bump_version.outputs.ytdlp_version }}"
915f2a92 136 - name: Run PyInstaller Script for 32 Bit
b3943b2f 137 run: python pyinst.py 32
7a5c1cfe 138 - name: Upload Executable yt-dlp_x86.exe
915f2a92
U
139 id: upload-release-windows32
140 uses: actions/upload-release-asset@v1
141 env:
142 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143 with:
144 upload_url: ${{ needs.build_unix.outputs.upload_url }}
7a5c1cfe
P
145 asset_path: ./dist/yt-dlp_x86.exe
146 asset_name: yt-dlp_x86.exe
98918847 147 asset_content_type: application/vnd.microsoft.portable-executable
7a5c1cfe 148 - name: Get SHA2-256SUMS for yt-dlp_x86.exe
915f2a92 149 id: sha2_file_win32
7a5c1cfe 150 run: echo "::set-output name=sha2_windows32::$((Get-FileHash dist\yt-dlp_x86.exe -Algorithm SHA256).Hash.ToLower())"
14b17a55 151
152 finish:
153 runs-on: ubuntu-latest
154 needs: [build_unix, build_windows, build_windows32]
155
156 steps:
915f2a92
U
157 - name: Make SHA2-256SUMS file
158 env:
159 SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }}
14b17a55 160 SHA2_WINDOWS32: ${{ needs.build_windows32.outputs.sha2_windows32 }}
915f2a92 161 SHA2_UNIX: ${{ needs.build_unix.outputs.sha2_unix }}
7a5c1cfe 162 YTDLP_VERSION: ${{ needs.build_unix.outputs.ytdlp_version }}
915f2a92 163 run: |
7a5c1cfe
P
164 echo "version:${env:YTDLP_VERSION}" >> SHA2-256SUMS
165 echo "yt-dlp.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS
166 echo "yt-dlp_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS
167 echo "yt-dlp:${env:SHA2_UNIX}" >> SHA2-256SUMS
da6403d3
TOH
168 - name: Upload 256SUMS file
169 id: upload-sums
170 uses: actions/upload-release-asset@v1
171 env:
172 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173 with:
174 upload_url: ${{ needs.build_unix.outputs.upload_url }}
175 asset_path: ./SHA2-256SUMS
176 asset_name: SHA2-256SUMS
177 asset_content_type: text/plain