]>
Commit | Line | Data |
---|---|---|
915f2a92 U |
1 | name: Build |
2 | ||
3 | on: | |
4 | push: | |
5 | branches: | |
6 | - release | |
7 | ||
8 | jobs: | |
93721ed0 | 9 | build_unix: |
915f2a92 U |
10 | |
11 | runs-on: ubuntu-latest | |
12 | ||
13 | outputs: | |
14 | ytdlc_version: ${{ steps.bump_version.outputs.ytdlc_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: | |
764876a0 | 23 | python-version: '3.8' |
915f2a92 U |
24 | - name: Install packages |
25 | run: sudo apt-get -y install zip pandoc man | |
26 | - name: Bump version | |
27 | id: bump_version | |
e38df8f9 | 28 | run: python devscripts/update-version.py |
29 | - name: Print version | |
c74618a0 | 30 | run: echo "${{ steps.bump_version.outputs.ytdlc_version }}" |
915f2a92 U |
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: | |
c74618a0 | 39 | tag_name: ${{ steps.bump_version.outputs.ytdlc_version }} |
298f597b | 40 | release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlc_version }} |
915f2a92 U |
41 | body: | |
42 | Changelog: | |
43 | PLACEHOLDER | |
44 | draft: false | |
45 | prerelease: false | |
46 | - name: Upload youtube-dlc 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: ./youtube-dlc | |
54 | asset_name: youtube-dlc | |
55 | asset_content_type: application/octet-stream | |
56 | - name: Get SHA2-256SUMS for youtube-dlc | |
57 | id: sha2_file | |
47930b73 | 58 | run: echo "::set-output name=sha2_unix::$(sha256sum youtube-dlc)" |
7bc877a2 | 59 | - name: Install dependencies for pypi |
60 | run: | | |
61 | python -m pip install --upgrade pip | |
62 | pip install setuptools wheel twine | |
63 | - name: Build and publish on pypi | |
64 | env: | |
65 | TWINE_USERNAME: __token__ | |
66 | TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
67 | run: | | |
68 | rm -rf dist/* | |
69 | python setup.py sdist bdist_wheel | |
70 | twine upload dist/* | |
915f2a92 | 71 | |
7e8772bf | 72 | build_windows: |
915f2a92 U |
73 | |
74 | runs-on: windows-latest | |
75 | ||
47930b73 | 76 | outputs: |
77 | sha2_windows: ${{ steps.sha2_file_win.outputs.sha2_windows }} | |
78 | ||
915f2a92 U |
79 | needs: build_unix |
80 | ||
81 | steps: | |
82 | - uses: actions/checkout@v2 | |
83 | - name: Set up Python | |
84 | uses: actions/setup-python@v2 | |
85 | with: | |
da8fb75d | 86 | python-version: '3.8' |
915f2a92 | 87 | - name: Install Requirements |
5d25607a | 88 | run: pip install pyinstaller mutagen pycryptodome |
915f2a92 | 89 | - name: Bump version |
e38df8f9 | 90 | id: bump_version |
91 | run: python devscripts/update-version.py | |
92 | - name: Print version | |
93 | run: echo "${{ steps.bump_version.outputs.ytdlc_version }}" | |
915f2a92 | 94 | - name: Run PyInstaller Script |
b3943b2f | 95 | run: python pyinst.py 64 |
915f2a92 U |
96 | - name: Upload youtube-dlc.exe Windows binary |
97 | id: upload-release-windows | |
98 | uses: actions/upload-release-asset@v1 | |
99 | env: | |
100 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
101 | with: | |
102 | upload_url: ${{ needs.build_unix.outputs.upload_url }} | |
103 | asset_path: ./dist/youtube-dlc.exe | |
104 | asset_name: youtube-dlc.exe | |
98918847 | 105 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
106 | - name: Get SHA2-256SUMS for youtube-dlc.exe |
107 | id: sha2_file_win | |
47930b73 | 108 | run: echo "::set-output name=sha2_windows::$(certUtil -hashfile dist\youtube-dlc.exe SHA256 | findstr -v :)" |
915f2a92 U |
109 | |
110 | build_windows32: | |
111 | ||
112 | runs-on: windows-latest | |
113 | ||
47930b73 | 114 | outputs: |
115 | sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }} | |
116 | ||
5943bb62 | 117 | needs: [build_unix, build_windows] |
915f2a92 U |
118 | |
119 | steps: | |
120 | - uses: actions/checkout@v2 | |
d052b9a1 | 121 | - name: Set up Python 3.4.4 32-Bit |
915f2a92 U |
122 | uses: actions/setup-python@v2 |
123 | with: | |
da8fb75d | 124 | python-version: '3.4.4' |
915f2a92 | 125 | architecture: 'x86' |
47930b73 | 126 | - name: Install VS libs |
127 | run: choco install vcexpress2010 | |
915f2a92 | 128 | - name: Install Requirements for 32 Bit |
47930b73 | 129 | run: pip install pyinstaller==3.5 mutagen pycryptodome |
915f2a92 | 130 | - name: Bump version |
e38df8f9 | 131 | id: bump_version |
132 | run: python devscripts/update-version.py | |
133 | - name: Print version | |
134 | run: echo "${{ steps.bump_version.outputs.ytdlc_version }}" | |
915f2a92 | 135 | - name: Run PyInstaller Script for 32 Bit |
b3943b2f | 136 | run: python pyinst.py 32 |
915f2a92 U |
137 | - name: Upload Executable youtube-dlc_x86.exe |
138 | id: upload-release-windows32 | |
139 | uses: actions/upload-release-asset@v1 | |
140 | env: | |
141 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
142 | with: | |
143 | upload_url: ${{ needs.build_unix.outputs.upload_url }} | |
144 | asset_path: ./dist/youtube-dlc_x86.exe | |
145 | asset_name: youtube-dlc_x86.exe | |
98918847 | 146 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
147 | - name: Get SHA2-256SUMS for youtube-dlc_x86.exe |
148 | id: sha2_file_win32 | |
47930b73 | 149 | run: echo "::set-output name=sha2_windows32::$(certUtil -hashfile dist\youtube-dlc_x86.exe SHA256 | findstr -v :)" |
915f2a92 U |
150 | - name: Make SHA2-256SUMS file |
151 | env: | |
152 | SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }} | |
153 | SHA2_WINDOWS32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }} | |
154 | SHA2_UNIX: ${{ needs.build_unix.outputs.sha2_unix }} | |
155 | YTDLC_VERSION: ${{ needs.build_unix.outputs.ytdlc_version }} | |
156 | run: | | |
5943bb62 TOH |
157 | echo "version:${env:YTDLC_VERSION}" >> SHA2-256SUMS |
158 | echo "youtube-dlc.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS | |
159 | echo "youtube-dlc_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS | |
160 | echo "youtube-dlc:${env:SHA2_UNIX}" >> SHA2-256SUMS | |
da6403d3 TOH |
161 | |
162 | - name: Upload 256SUMS file | |
163 | id: upload-sums | |
164 | uses: actions/upload-release-asset@v1 | |
165 | env: | |
166 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
167 | with: | |
168 | upload_url: ${{ needs.build_unix.outputs.upload_url }} | |
169 | asset_path: ./SHA2-256SUMS | |
170 | asset_name: SHA2-256SUMS | |
171 | asset_content_type: text/plain | |
b2f70ae7 | 172 | |
4ff5e989 | 173 | # update_version_badge: |
174 | # runs-on: ubuntu-latest | |
175 | # needs: build_unix | |
176 | # steps: | |
177 | # - name: Create Version Badge | |
178 | # uses: schneegans/dynamic-badges-action@v1.0.0 | |
179 | # with: | |
180 | # auth: ${{ secrets.GIST_TOKEN }} | |
181 | # gistID: c69cb23c3c5b3316248e52022790aa57 | |
182 | # filename: version.json | |
183 | # label: Version | |
184 | # message: ${{ needs.build_unix.outputs.ytdlc_version }} |