]>
Commit | Line | Data |
---|---|---|
915f2a92 U |
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.x' | |
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: Run Make | |
30 | run: make | |
31 | - name: Create Release | |
32 | id: create_release | |
33 | uses: actions/create-release@v1 | |
34 | env: | |
35 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
36 | with: | |
37 | tag_name: ${{ github.ref }} | |
38 | release_name: youtube-dlc ${{ steps.dump_version.outputs.ytdlc_version }} | |
39 | body: | | |
40 | Changelog: | |
41 | PLACEHOLDER | |
42 | draft: false | |
43 | prerelease: false | |
44 | - name: Upload youtube-dlc Unix binary | |
45 | id: upload-release-asset | |
46 | uses: actions/upload-release-asset@v1 | |
47 | env: | |
48 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
49 | with: | |
50 | upload_url: ${{ steps.create_release.outputs.upload_url }} | |
51 | asset_path: ./youtube-dlc | |
52 | asset_name: youtube-dlc | |
53 | asset_content_type: application/octet-stream | |
54 | - name: Get SHA2-256SUMS for youtube-dlc | |
55 | id: sha2_file | |
56 | env: | |
57 | SHA2: ${{ hashFiles('youtube-dlc') }} | |
58 | run: echo "::set-output name=sha2_unix::${env:SHA2}" | |
59 | ||
60 | build_windows: | |
61 | ||
62 | runs-on: windows-latest | |
63 | ||
64 | needs: build_unix | |
65 | ||
66 | steps: | |
67 | - uses: actions/checkout@v2 | |
68 | - name: Set up Python | |
69 | uses: actions/setup-python@v2 | |
70 | with: | |
71 | python-version: '3.x' | |
72 | - name: Install Requirements | |
73 | run: pip install pyinstaller | |
74 | - name: Bump version | |
75 | run: python scripts/update-version-workflow.py | |
76 | - name: Run PyInstaller Script | |
77 | run: python pyinst.py | |
78 | - name: Upload youtube-dlc.exe Windows binary | |
79 | id: upload-release-windows | |
80 | uses: actions/upload-release-asset@v1 | |
81 | env: | |
82 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
83 | with: | |
84 | upload_url: ${{ needs.build_unix.outputs.upload_url }} | |
85 | asset_path: ./dist/youtube-dlc.exe | |
86 | asset_name: youtube-dlc.exe | |
87 | asset_content_type: application/octet-stream | |
88 | - name: Get SHA2-256SUMS for youtube-dlc.exe | |
89 | id: sha2_file_win | |
90 | env: | |
91 | SHA2: ${{ hashFiles('dist/youtube-dlc.exe') }} | |
92 | run: echo "::set-output name=sha2_windows::${env:SHA2}" | |
93 | ||
94 | build_windows32: | |
95 | ||
96 | runs-on: windows-latest | |
97 | ||
98 | needs: build_unix | |
99 | ||
100 | steps: | |
101 | - uses: actions/checkout@v2 | |
102 | - name: Set up Python 3.4.2 32-Bit | |
103 | uses: actions/setup-python@v2 | |
104 | with: | |
105 | python-version: '3.4.2' | |
106 | architecture: 'x86' | |
107 | - name: Install Requirements for 32 Bit | |
108 | run: pip install pyinstaller==3.5 | |
109 | - name: Bump version | |
110 | run: python scripts/update-version-workflow.py | |
111 | - name: Run PyInstaller Script for 32 Bit | |
112 | run: python pyinst32.py | |
113 | - name: Upload Executable youtube-dlc_x86.exe | |
114 | id: upload-release-windows32 | |
115 | uses: actions/upload-release-asset@v1 | |
116 | env: | |
117 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
118 | with: | |
119 | upload_url: ${{ needs.build_unix.outputs.upload_url }} | |
120 | asset_path: ./dist/youtube-dlc_x86.exe | |
121 | asset_name: youtube-dlc_x86.exe | |
122 | asset_content_type: application/octet-stream | |
123 | - name: Get SHA2-256SUMS for youtube-dlc_x86.exe | |
124 | id: sha2_file_win32 | |
125 | env: | |
126 | SHA2: ${{ hashFiles('dist/youtube-dlc_x86.exe') }} | |
127 | run: echo "::set-output name=sha2_windows32::${env:SHA2}" | |
128 | - name: Make SHA2-256SUMS file | |
129 | env: | |
130 | SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }} | |
131 | SHA2_WINDOWS32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }} | |
132 | SHA2_UNIX: ${{ needs.build_unix.outputs.sha2_unix }} | |
133 | YTDLC_VERSION: ${{ needs.build_unix.outputs.ytdlc_version }} | |
134 | run: | | |
135 | echo "$SHA2_WINDOWS youtube-dlc.exe" > SHA2-256SUMS | |
136 | echo "$SHA2_WINDOWS32 youtube-dlc32.exe" > SHA2-256SUMS | |
137 | echo "$SHA2_UNIX youtube-dlc" >> SHA2-256SUMS | |
138 | ||
139 | deploy: | |
140 | ||
141 | runs-on: ubuntu-latest | |
142 | ||
143 | steps: | |
144 | - uses: actions/checkout@v2 | |
145 | - name: Set up Python | |
146 | uses: actions/setup-python@v2 | |
147 | with: | |
148 | python-version: '3.x' | |
149 | - name: Install dependencies | |
150 | run: | | |
151 | python -m pip install --upgrade pip | |
152 | pip install setuptools wheel twine | |
153 | - name: Bump version | |
154 | run: python scripts/update-version-workflow.py | |
155 | - name: Build and publish | |
156 | env: | |
157 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
158 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
159 | run: | | |
160 | rm -rf dist/* | |
161 | python setup.py sdist bdist_wheel | |
162 | twine upload dist/* |