]> jfr.im git - yt-dlp.git/blame - .github/workflows/build.yml
Completely change project name to yt-dlp (#85)
[yt-dlp.git] / .github / workflows / build.yml
CommitLineData
915f2a92
U
1name: Build
2
3on:
4 push:
5 branches:
6 - release
7
8jobs:
93721ed0 9 build_unix:
915f2a92
U
10
11 runs-on: ubuntu-latest
12
13 outputs:
7a5c1cfe 14 ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }}
915f2a92
U
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
7a5c1cfe 30 run: echo "${{ steps.bump_version.outputs.ytdlp_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:
7a5c1cfe
P
39 tag_name: ${{ steps.bump_version.outputs.ytdlp_version }}
40 release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlp_version }}
915f2a92
U
41 body: |
42 Changelog:
43 PLACEHOLDER
44 draft: false
45 prerelease: false
7a5c1cfe 46 - name: Upload yt-dlp Unix binary
915f2a92
U
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 }}
7a5c1cfe
P
53 asset_path: ./yt-dlp
54 asset_name: yt-dlp
915f2a92 55 asset_content_type: application/octet-stream
7a5c1cfe 56 - name: Get SHA2-256SUMS for yt-dlp
915f2a92 57 id: sha2_file
7a5c1cfe 58 run: echo "::set-output name=sha2_unix::$(sha256sum yt-dlp | 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
7a5c1cfe 99 run: echo "${{ steps.bump_version.outputs.ytdlp_version }}"
915f2a92 100 - name: Run PyInstaller Script
b3943b2f 101 run: python pyinst.py 64
7a5c1cfe 102 - name: Upload yt-dlp.exe Windows binary
915f2a92
U
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 }}
7a5c1cfe
P
109 asset_path: ./dist/yt-dlp.exe
110 asset_name: yt-dlp.exe
98918847 111 asset_content_type: application/vnd.microsoft.portable-executable
7a5c1cfe 112 - name: Get SHA2-256SUMS for yt-dlp.exe
915f2a92 113 id: sha2_file_win
7a5c1cfe 114 run: echo "::set-output name=sha2_windows::$((Get-FileHash dist\yt-dlp.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
7a5c1cfe 140 run: echo "${{ steps.bump_version.outputs.ytdlp_version }}"
915f2a92 141 - name: Run PyInstaller Script for 32 Bit
b3943b2f 142 run: python pyinst.py 32
7a5c1cfe 143 - name: Upload Executable yt-dlp_x86.exe
915f2a92
U
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 }}
7a5c1cfe
P
150 asset_path: ./dist/yt-dlp_x86.exe
151 asset_name: yt-dlp_x86.exe
98918847 152 asset_content_type: application/vnd.microsoft.portable-executable
7a5c1cfe 153 - name: Get SHA2-256SUMS for yt-dlp_x86.exe
915f2a92 154 id: sha2_file_win32
7a5c1cfe 155 run: echo "::set-output name=sha2_windows32::$((Get-FileHash dist\yt-dlp_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 }}
7a5c1cfe 161 YTDLP_VERSION: ${{ needs.build_unix.outputs.ytdlp_version }}
915f2a92 162 run: |
7a5c1cfe
P
163 echo "version:${env:YTDLP_VERSION}" >> SHA2-256SUMS
164 echo "yt-dlp.exe:${env:SHA2_WINDOWS}" >> SHA2-256SUMS
165 echo "yt-dlp_x86.exe:${env:SHA2_WINDOWS32}" >> SHA2-256SUMS
166 echo "yt-dlp:${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