]> jfr.im git - yt-dlp.git/blob - .github/workflows/build.yml
#93 Build improvements
[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 | awk '{print $1}')"
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: Upgrade pip and enable wheel support
88 run: python -m pip install --upgrade pip setuptools wheel
89 - name: Install Requirements
90 run: pip install pyinstaller mutagen pycryptodome
91 - name: Bump version
92 id: bump_version
93 run: python devscripts/update-version.py
94 - name: Print version
95 run: echo "${{ steps.bump_version.outputs.ytdlc_version }}"
96 - name: Run PyInstaller Script
97 run: python pyinst.py 64
98 - name: Upload youtube-dlc.exe Windows binary
99 id: upload-release-windows
100 uses: actions/upload-release-asset@v1
101 env:
102 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103 with:
104 upload_url: ${{ needs.build_unix.outputs.upload_url }}
105 asset_path: ./dist/youtube-dlc.exe
106 asset_name: youtube-dlc.exe
107 asset_content_type: application/vnd.microsoft.portable-executable
108 - name: Get SHA2-256SUMS for youtube-dlc.exe
109 id: sha2_file_win
110 run: echo "::set-output name=sha2_windows::$((Get-FileHash dist\youtube-dlc.exe -Algorithm SHA256).Hash.ToLower())"
111
112 build_windows32:
113
114 runs-on: windows-latest
115
116 outputs:
117 sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }}
118
119 needs: [build_unix, build_windows]
120
121 steps:
122 - uses: actions/checkout@v2
123 - name: Set up Python 3.4.4 32-Bit
124 uses: actions/setup-python@v2
125 with:
126 python-version: '3.4.4'
127 architecture: 'x86'
128 - name: Upgrade pip and enable wheel support
129 run: python -m pip install pip==19.1.1 setuptools==43.0.0 wheel==0.33.6
130 - name: Install Requirements for 32 Bit
131 run: pip install pyinstaller==3.5 mutagen==1.42.0 pycryptodome==3.9.4
132 - name: Bump version
133 id: bump_version
134 run: python devscripts/update-version.py
135 - name: Print version
136 run: echo "${{ steps.bump_version.outputs.ytdlc_version }}"
137 - name: Run PyInstaller Script for 32 Bit
138 run: python pyinst.py 32
139 - name: Upload Executable youtube-dlc_x86.exe
140 id: upload-release-windows32
141 uses: actions/upload-release-asset@v1
142 env:
143 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144 with:
145 upload_url: ${{ needs.build_unix.outputs.upload_url }}
146 asset_path: ./dist/youtube-dlc_x86.exe
147 asset_name: youtube-dlc_x86.exe
148 asset_content_type: application/vnd.microsoft.portable-executable
149 - name: Get SHA2-256SUMS for youtube-dlc_x86.exe
150 id: sha2_file_win32
151 run: echo "::set-output name=sha2_windows32::$((Get-FileHash dist\youtube-dlc_x86.exe -Algorithm SHA256).Hash.ToLower())"
152 - name: Make SHA2-256SUMS file
153 env:
154 SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }}
155 SHA2_WINDOWS32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }}
156 SHA2_UNIX: ${{ needs.build_unix.outputs.sha2_unix }}
157 YTDLC_VERSION: ${{ needs.build_unix.outputs.ytdlc_version }}
158 run: |
159 echo "version:${env:YTDLC_VERSION}" >> SHA2-256SUMS
160 echo "youtube-dlc.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS
161 echo "youtube-dlc_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS
162 echo "youtube-dlc:${env:SHA2_UNIX}" >> SHA2-256SUMS
163
164 - name: Upload 256SUMS file
165 id: upload-sums
166 uses: actions/upload-release-asset@v1
167 env:
168 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169 with:
170 upload_url: ${{ needs.build_unix.outputs.upload_url }}
171 asset_path: ./SHA2-256SUMS
172 asset_name: SHA2-256SUMS
173 asset_content_type: text/plain
174
175 # update_version_badge:
176 # runs-on: ubuntu-latest
177 # needs: build_unix
178 # steps:
179 # - name: Create Version Badge
180 # uses: schneegans/dynamic-badges-action@v1.0.0
181 # with:
182 # auth: ${{ secrets.GIST_TOKEN }}
183 # gistID: c69cb23c3c5b3316248e52022790aa57
184 # filename: version.json
185 # label: Version
186 # message: ${{ needs.build_unix.outputs.ytdlc_version }}