]> jfr.im git - yt-dlp.git/blob - .github/workflows/build.yml
Update version badge automatically in README
[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 scripts/update-version-workflow.py
29 - name: Check the output from My action
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: youtube-dlc ${{ 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 env:
59 SHA2: ${{ hashFiles('youtube-dlc') }}
60 run: echo "::set-output name=sha2_unix::$SHA2"
61 # - name: Install dependencies for pypi
62 # run: |
63 # python -m pip install --upgrade pip
64 # pip install setuptools wheel twine
65 # - name: Build and publish
66 # env:
67 # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
68 # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
69 # run: |
70 # rm -rf dist/*
71 # python setup.py sdist bdist_wheel
72 # twine upload dist/*
73
74 build_windows:
75
76 runs-on: windows-latest
77
78 needs: build_unix
79
80 steps:
81 - uses: actions/checkout@v2
82 - name: Set up Python
83 uses: actions/setup-python@v2
84 with:
85 python-version: '3.8'
86 - name: Install Requirements
87 run: pip install pyinstaller
88 - name: Bump version
89 run: python scripts/update-version-workflow.py
90 - name: Run PyInstaller Script
91 run: python pyinst.py
92 - name: Upload youtube-dlc.exe Windows binary
93 id: upload-release-windows
94 uses: actions/upload-release-asset@v1
95 env:
96 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 with:
98 upload_url: ${{ needs.build_unix.outputs.upload_url }}
99 asset_path: ./dist/youtube-dlc.exe
100 asset_name: youtube-dlc.exe
101 asset_content_type: application/vnd.microsoft.portable-executable
102 - name: Get SHA2-256SUMS for youtube-dlc.exe
103 id: sha2_file_win
104 env:
105 SHA2_win: ${{ hashFiles('dist/youtube-dlc.exe') }}
106 run: echo "::set-output name=sha2_windows::$SHA2_win"
107
108 build_windows32:
109
110 runs-on: windows-latest
111
112 needs: [build_unix, build_windows]
113
114 steps:
115 - uses: actions/checkout@v2
116 - name: Set up Python 3.4.4 32-Bit
117 uses: actions/setup-python@v2
118 with:
119 python-version: '3.4.4'
120 architecture: 'x86'
121 - name: Install Requirements for 32 Bit
122 run: pip install pyinstaller==3.5
123 - name: Bump version
124 run: python scripts/update-version-workflow.py
125 - name: Run PyInstaller Script for 32 Bit
126 run: python pyinst32.py
127 - name: Upload Executable youtube-dlc_x86.exe
128 id: upload-release-windows32
129 uses: actions/upload-release-asset@v1
130 env:
131 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132 with:
133 upload_url: ${{ needs.build_unix.outputs.upload_url }}
134 asset_path: ./dist/youtube-dlc_x86.exe
135 asset_name: youtube-dlc_x86.exe
136 asset_content_type: application/vnd.microsoft.portable-executable
137 - name: Get SHA2-256SUMS for youtube-dlc_x86.exe
138 id: sha2_file_win32
139 env:
140 SHA2_win32: ${{ hashFiles('dist/youtube-dlc_x86.exe') }}
141 run: echo "::set-output name=sha2_windows32::$SHA2_win32"
142 - name: Make SHA2-256SUMS file
143 env:
144 SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }}
145 SHA2_WINDOWS32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }}
146 SHA2_UNIX: ${{ needs.build_unix.outputs.sha2_unix }}
147 YTDLC_VERSION: ${{ needs.build_unix.outputs.ytdlc_version }}
148 run: |
149 echo "version:${env:YTDLC_VERSION}" >> SHA2-256SUMS
150 echo "youtube-dlc.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS
151 echo "youtube-dlc_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS
152 echo "youtube-dlc:${env:SHA2_UNIX}" >> SHA2-256SUMS
153
154 - name: Upload 256SUMS file
155 id: upload-sums
156 uses: actions/upload-release-asset@v1
157 env:
158 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159 with:
160 upload_url: ${{ needs.build_unix.outputs.upload_url }}
161 asset_path: ./SHA2-256SUMS
162 asset_name: SHA2-256SUMS
163 asset_content_type: text/plain
164
165 update_version_badge:
166
167 runs-on: ubuntu-latest
168
169 needs: build_unix
170
171 steps:
172 - name: Create Version Badge
173 uses: schneegans/dynamic-badges-action@v1.0.0
174 with:
175 auth: ${{ secrets.GIST_TOKEN }}
176 gistID: c69cb23c3c5b3316248e52022790aa57
177 filename: version.json
178 label: Version
179 message: ${{ needs.build_unix.outputs.ytdlc_version }}