]> jfr.im git - yt-dlp.git/blob - .github/workflows/build.yml
Fix build.yml hashing and crypto support (#87)
[yt-dlp.git] / .github / workflows / build.yml
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 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:
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.ytdlc_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.ytdlc_version }}
40 release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlc_version }}
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
58 run: echo "::set-output name=sha2_unix::$(sha256sum youtube-dlc)"
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/*
71
72 build_windows:
73
74 runs-on: windows-latest
75
76 outputs:
77 sha2_windows: ${{ steps.sha2_file_win.outputs.sha2_windows }}
78
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:
86 python-version: '3.8'
87 - name: Install Requirements
88 run: pip install pyinstaller mutagen pycryptodome
89 - name: Bump version
90 id: bump_version
91 run: python devscripts/update-version.py
92 - name: Print version
93 run: echo "${{ steps.bump_version.outputs.ytdlc_version }}"
94 - name: Run PyInstaller Script
95 run: python pyinst.py 64
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
105 asset_content_type: application/vnd.microsoft.portable-executable
106 - name: Get SHA2-256SUMS for youtube-dlc.exe
107 id: sha2_file_win
108 run: echo "::set-output name=sha2_windows::$(certUtil -hashfile dist\youtube-dlc.exe SHA256 | findstr -v :)"
109
110 build_windows32:
111
112 runs-on: windows-latest
113
114 outputs:
115 sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }}
116
117 needs: [build_unix, build_windows]
118
119 steps:
120 - uses: actions/checkout@v2
121 - name: Set up Python 3.4.4 32-Bit
122 uses: actions/setup-python@v2
123 with:
124 python-version: '3.4.4'
125 architecture: 'x86'
126 - name: Install VS libs
127 run: choco install vcexpress2010
128 - name: Install Requirements for 32 Bit
129 run: pip install pyinstaller==3.5 mutagen pycryptodome
130 - name: Bump version
131 id: bump_version
132 run: python devscripts/update-version.py
133 - name: Print version
134 run: echo "${{ steps.bump_version.outputs.ytdlc_version }}"
135 - name: Run PyInstaller Script for 32 Bit
136 run: python pyinst.py 32
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
146 asset_content_type: application/vnd.microsoft.portable-executable
147 - name: Get SHA2-256SUMS for youtube-dlc_x86.exe
148 id: sha2_file_win32
149 run: echo "::set-output name=sha2_windows32::$(certUtil -hashfile dist\youtube-dlc_x86.exe SHA256 | findstr -v :)"
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: |
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
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
172
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 }}