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