This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
forked from lay295/TwitchDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (201 loc) · 8.98 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: Build and Upload Release
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release Tag'
required: true
default: '1.0.0'
jobs:
create-release:
runs-on: ubuntu-20.04
steps:
- name: Create a Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
tag_name: ${{ github.event.inputs.release_tag }}
# The name of the release. For example, `Release v1.0.1`
release_name: ${{ github.event.inputs.release_tag }}
- shell: bash
run: |
expr "${{ steps.create_release.outputs.upload_url }}" > upload_url.txt
- name: Upload URL
uses: actions/upload-artifact@v2
with:
name: upload_url
path: upload_url.txt
build:
runs-on: windows-latest
needs: [create-release]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v1
name: Checkout Code
- name: Setup MSBuild Path
uses: warrenbuckley/Setup-MSBuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.2
- name: Restore NuGet Packages
run: nuget restore TwitchDownloaderWPF.sln
- name: Build
run: msbuild TwitchDownloaderWPF.sln /p:Configuration=Debug /p:DebugType=None /p:DebugSymbols=false /p:AllowedReferenceRelatedFileExtensions=none /p:DeployOnBuild=true
- name: Download File To Workspace
# You may pin to the exact commit or the version.
# uses: carlosperate/download-file-action@e85e0aa6262f13571d17a4a39687b26981c583dc
uses: carlosperate/download-file-action@v1.0.3
with:
# URL of the file to download
file-url: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
# New filename to rename the downloaded file
file-name: ffmpeg.zip
- name: Bundle ffmpeg
run: tar xfz ffmpeg.zip --strip-components=1; copy bin/ffmpeg.exe TwitchDownloaderWPF/bin/Debug/ffmpeg.exe
- name: Zip Release
uses: papeloto/action-zip@v1
with:
files: "TwitchDownloaderWPF/bin/Debug"
dest: release.zip
- name: Download URL
uses: actions/download-artifact@v2
with:
name: upload_url
- name: Read URL
id: url
uses: juliangruber/read-file-action@74dc4b4435b60f96f84bcba916659c779f46ba0a
with:
path: upload_url.txt
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: release.zip
asset_name: release.zip
asset_content_type: application/zip
build-cli:
runs-on: ubuntu-20.04
needs: [create-release, build]
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=Windows /p:DebugType=None /p:DebugSymbols=false
- name: Build
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=Linux /p:DebugType=None /p:DebugSymbols=false
- name: Build
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=LinuxAlpine /p:DebugType=None /p:DebugSymbols=false
- name: Build
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=LinuxArm /p:DebugType=None /p:DebugSymbols=false
- name: Zip Windows CLI
uses: papeloto/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/netcoreapp3.1/publish/Windows/TwitchDownloaderCLI.exe
dest: TwitchDownloaderCLI-Windows-x64.zip
- name: Zip Linux CLI
uses: papeloto/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/netcoreapp3.1/publish/Linux/TwitchDownloaderCLI
dest: TwitchDownloaderCLI-Linux-x64.zip
- name: Zip LinuxAlpine CLI
uses: papeloto/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/netcoreapp3.1/publish/LinuxAlpine/TwitchDownloaderCLI
dest: TwitchDownloaderCLI-LinuxAlpine-x64.zip
- name: Zip LinuxArm CLI
uses: papeloto/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/netcoreapp3.1/publish/LinuxArm/TwitchDownloaderCLI
dest: TwitchDownloaderCLI-LinuxArm.zip
- name: Download URL
uses: actions/download-artifact@v2
with:
name: upload_url
- name: Read URL
id: url
uses: juliangruber/read-file-action@74dc4b4435b60f96f84bcba916659c779f46ba0a
with:
path: upload_url.txt
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-Windows-x64.zip
asset_name: TwitchDownloaderCLI-Windows-x64.zip
asset_content_type: application/zip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-Linux-x64.zip
asset_name: TwitchDownloaderCLI-Linux-x64.zip
asset_content_type: application/zip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-LinuxAlpine-x64.zip
asset_name: TwitchDownloaderCLI-LinuxAlpine-x64.zip
asset_content_type: application/zip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-LinuxArm.zip
asset_name: TwitchDownloaderCLI-LinuxArm.zip
asset_content_type: application/zip
build-cli-mac:
runs-on: macos-10.15
needs: [create-release, build-cli]
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOS /p:DebugType=None /p:DebugSymbols=false
- name: Zip Release
uses: papeloto/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/netcoreapp3.1/publish/MacOS/TwitchDownloaderCLI
dest: TwitchDownloaderCLI-MacOS-x64.zip
- name: Download URL
uses: actions/download-artifact@v2
with:
name: upload_url
- name: Read URL
id: url
uses: juliangruber/read-file-action@74dc4b4435b60f96f84bcba916659c779f46ba0a
with:
path: upload_url.txt
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-MacOS-x64.zip
asset_name: TwitchDownloaderCLI-MacOS-x64.zip
asset_content_type: application/zip