]>
Commit | Line | Data |
---|---|---|
915f2a92 U |
1 | name: Build |
2 | ||
3 | on: | |
4 | push: | |
5 | branches: | |
6 | - release | |
7 | ||
8 | jobs: | |
93721ed0 | 9 | build_unix: |
915f2a92 U |
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 | |
c74618a0 TOH |
29 | - name: Check the output from My action |
30 | run: echo "${{ steps.bump_version.outputs.ytdlc_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: | |
c74618a0 TOH |
39 | tag_name: ${{ steps.bump_version.outputs.ytdlc_version }} |
40 | release_name: youtube-dlc ${{ steps.bump_version.outputs.ytdlc_version }} | |
915f2a92 U |
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') }} | |
98918847 | 60 | run: echo "::set-output name=sha2_unix::$SHA2" |
8a28bd24 TOH |
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/* | |
915f2a92 | 73 | |
7e8772bf | 74 | build_windows: |
915f2a92 U |
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.x' | |
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 | |
98918847 | 101 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
102 | - name: Get SHA2-256SUMS for youtube-dlc.exe |
103 | id: sha2_file_win | |
104 | env: | |
98918847 TOH |
105 | SHA2_win: ${{ hashFiles('dist/youtube-dlc.exe') }} |
106 | run: echo "::set-output name=sha2_windows::$SHA2_win" | |
915f2a92 U |
107 | |
108 | build_windows32: | |
109 | ||
110 | runs-on: windows-latest | |
111 | ||
5943bb62 | 112 | needs: [build_unix, build_windows] |
915f2a92 U |
113 | |
114 | steps: | |
115 | - uses: actions/checkout@v2 | |
eb98353b | 116 | - name: Set up Python 3.5.4 32-Bit |
915f2a92 U |
117 | uses: actions/setup-python@v2 |
118 | with: | |
eb98353b | 119 | python-version: '3.5.4' |
915f2a92 U |
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 | |
98918847 | 136 | asset_content_type: application/vnd.microsoft.portable-executable |
915f2a92 U |
137 | - name: Get SHA2-256SUMS for youtube-dlc_x86.exe |
138 | id: sha2_file_win32 | |
139 | env: | |
98918847 TOH |
140 | SHA2_win32: ${{ hashFiles('dist/youtube-dlc_x86.exe') }} |
141 | run: echo "::set-output name=sha2_windows32::$SHA2_win32" | |
915f2a92 U |
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: | | |
5943bb62 TOH |
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 | |
da6403d3 TOH |
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 |