-
Notifications
You must be signed in to change notification settings - Fork 4
286 lines (244 loc) · 12.6 KB
/
build.yml
File metadata and controls
286 lines (244 loc) · 12.6 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
name: Build
on:
push:
branches:
- '**'
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
jobs:
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
# Publish
- name: Define MSBuild properties
run: echo "MSBUILD_PROPS=-p:PublishSingleFile=true -p:PublishTrimmed=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:InvariantGlobalization=true" >> $GITHUB_ENV
- name: Publish framework-dependent
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release --no-restore
dotnet publish src/CubicBot.Telegram.Webhook -c Release --no-restore
dotnet publish src/CubicBot.Telegram.Tool -c Release --no-restore
- name: Publish self-contained for Linux ARM64
if: matrix.os == 'ubuntu-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r linux-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r linux-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r linux-arm64 --self-contained
- name: Publish self-contained for Linux x64
if: matrix.os == 'ubuntu-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r linux-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r linux-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r linux-x64 --self-contained
- name: Publish self-contained for Windows ARM64
if: matrix.os == 'windows-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r win-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r win-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r win-arm64 --self-contained
- name: Publish self-contained for Windows x64
if: matrix.os == 'windows-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r win-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r win-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r win-x64 --self-contained
- name: Publish self-contained for macOS ARM64
if: matrix.os == 'macos-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r osx-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r osx-arm64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r osx-arm64 --self-contained
- name: Publish self-contained for macOS x64
if: matrix.os == 'macos-latest'
run: |
dotnet publish src/CubicBot.Telegram.LongPolling -c Release $MSBUILD_PROPS -r osx-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Webhook -c Release $MSBUILD_PROPS -r osx-x64 --self-contained
dotnet publish src/CubicBot.Telegram.Tool -c Release $MSBUILD_PROPS -r osx-x64 --self-contained
# Upload CubicBot.Telegram.LongPolling
- name: Upload CubicBot.Telegram.LongPolling artifacts for Linux ARM64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux-arm64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/linux-arm64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for Linux x64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux-x64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/linux-x64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows-arm64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/win-arm64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows-x64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/win-x64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for macOS ARM64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-macos-arm64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/osx-arm64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for macOS x64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-macos-x64
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/osx-x64/publish/
- name: Upload CubicBot.Telegram.LongPolling artifacts for macOS framework-dependent
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-app-${{ github.sha }}-macos
path: src/CubicBot.Telegram.LongPolling/bin/Release/net10.0/publish/
# Upload CubicBot.Telegram.Webhook
- name: Upload CubicBot.Telegram.Webhook artifacts for Linux ARM64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-linux-arm64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/linux-arm64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for Linux x64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-linux-x64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/linux-x64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-linux
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-windows-arm64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/win-arm64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-windows-x64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/win-x64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-windows
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for macOS ARM64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-macos-arm64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/osx-arm64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for macOS x64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-macos-x64
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/osx-x64/publish/
- name: Upload CubicBot.Telegram.Webhook artifacts for macOS framework-dependent
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-webhook-${{ github.sha }}-macos
path: src/CubicBot.Telegram.Webhook/bin/Release/net10.0/publish/
# Upload CubicBot.Telegram.Tool
- name: Upload CubicBot.Telegram.Tool artifacts for Linux ARM64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-arm64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/linux-arm64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for Linux x64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-x64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/linux-x64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-arm64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/win-arm64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-x64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/win-x64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for macOS ARM64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-macos-arm64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/osx-arm64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for macOS x64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-macos-x64
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/osx-x64/publish/
- name: Upload CubicBot.Telegram.Tool artifacts for macOS framework-dependent
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v7
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-macos
path: src/CubicBot.Telegram.Tool/bin/Release/net10.0/publish/