]>
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 | |
55e36f03 | 58 | run: echo "::set-output name=sha2_unix::$(sha256sum youtube-dlc | awk '{print $1}')" |
7bc877a2 | 59 | - name: Install dependencies for pypi |
2a86f3da | 60 | env: |
61 | PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
62 | if: "env.PYPI_TOKEN != ''" | |
7bc877a2 | 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 }} | |
2a86f3da | 70 | if: "env.TWINE_PASSWORD != ''" |
7bc877a2 | 71 | run: | |
72 | rm -rf dist/* | |
73 | python setup.py sdist bdist_wheel | |
74 | twine upload dist/* | |
915f2a92 | 75 | |
7e8772bf | 76 | build_windows: |
915f2a92 U |
77 | |
78 | runs-on: windows-latest | |
79 | ||
47930b73 | 80 | outputs: |
81 | sha2_windows: ${{ steps.sha2_file_win.outputs.sha2_windows }} | |
82 | ||
915f2a92 U |
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: | |
da8fb75d | 90 | python-version: '3.8' |
55e36f03 | 91 | - name: Upgrade pip and enable wheel support |
92 | run: python -m pip install --upgrade pip setuptools wheel | |
915f2a92 | 93 | - name: Install Requirements |
5d25607a | 94 | run: pip install pyinstaller mutagen pycryptodome |
915f2a92 | 95 | - name: Bump version |
e38df8f9 | 96 | id: bump_version |
97 | run: python devscripts/update-version.py | |
98 | - name: Print version | |
99 | run: echo "${{ steps.bump_version.outputs.ytdlc_version }}" | |
915f2a92 | 100 | - name: Run PyInstaller Script |
b3943b2f | 101 | run: python pyinst.py 64 |
915f2a92 U |
102 | - name: Upload youtube-dlc.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/youtube-dlc.exe | |
110 | asset_name: youtube-dlc.exe | |
98918847 | 111 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
112 | - name: Get SHA2-256SUMS for youtube-dlc.exe |
113 | id: sha2_file_win | |
55e36f03 | 114 | run: echo "::set-output name=sha2_windows::$((Get-FileHash dist\youtube-dlc.exe -Algorithm SHA256).Hash.ToLower())" |
915f2a92 U |
115 | |
116 | build_windows32: | |
117 | ||
118 | runs-on: windows-latest | |
119 | ||
47930b73 | 120 | outputs: |
121 | sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }} | |
122 | ||
5943bb62 | 123 | needs: [build_unix, build_windows] |
915f2a92 U |
124 | |
125 | steps: | |
126 | - uses: actions/checkout@v2 | |
d052b9a1 | 127 | - name: Set up Python 3.4.4 32-Bit |
915f2a92 U |
128 | uses: actions/setup-python@v2 |
129 | with: | |
da8fb75d | 130 | python-version: '3.4.4' |
915f2a92 | 131 | architecture: 'x86' |
55e36f03 | 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 | |
915f2a92 | 134 | - name: Install Requirements for 32 Bit |
55e36f03 | 135 | run: pip install pyinstaller==3.5 mutagen==1.42.0 pycryptodome==3.9.4 |
915f2a92 | 136 | - name: Bump version |
e38df8f9 | 137 | id: bump_version |
138 | run: python devscripts/update-version.py | |
139 | - name: Print version | |
140 | run: echo "${{ steps.bump_version.outputs.ytdlc_version }}" | |
915f2a92 | 141 | - name: Run PyInstaller Script for 32 Bit |
b3943b2f | 142 | run: python pyinst.py 32 |
915f2a92 U |
143 | - name: Upload Executable youtube-dlc_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/youtube-dlc_x86.exe | |
151 | asset_name: youtube-dlc_x86.exe | |
98918847 | 152 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
153 | - name: Get SHA2-256SUMS for youtube-dlc_x86.exe |
154 | id: sha2_file_win32 | |
55e36f03 | 155 | run: echo "::set-output name=sha2_windows32::$((Get-FileHash dist\youtube-dlc_x86.exe -Algorithm SHA256).Hash.ToLower())" |
915f2a92 U |
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 | YTDLC_VERSION: ${{ needs.build_unix.outputs.ytdlc_version }} | |
162 | run: | | |
5943bb62 TOH |
163 | echo "version:${env:YTDLC_VERSION}" >> SHA2-256SUMS |
164 | echo "youtube-dlc.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS | |
165 | echo "youtube-dlc_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS | |
166 | echo "youtube-dlc:${env:SHA2_UNIX}" >> SHA2-256SUMS | |
da6403d3 TOH |
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 |