Skip to content

Commit aea7ffa

Browse files
committed
🔟 Upgrade to .NET 10
Migrate solution file to SLNX.
1 parent 88d8d2b commit aea7ffa

File tree

10 files changed

+61
-83
lines changed

10 files changed

+61
-83
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup dotnet
3131
uses: actions/setup-dotnet@v5
3232
with:
33-
dotnet-version: '9'
33+
dotnet-version: '10'
3434

3535
- name: Restore dependencies
3636
run: dotnet restore
@@ -92,124 +92,124 @@ jobs:
9292
uses: actions/upload-artifact@v5
9393
with:
9494
name: cubic-bot-telegram-app-${{ github.sha }}-linux-arm64
95-
path: CubicBot.Telegram.App/bin/Release/net9.0/linux-arm64/publish/
95+
path: CubicBot.Telegram.App/bin/Release/net10.0/linux-arm64/publish/
9696

9797
- name: Upload CubicBot.Telegram.App artifacts for Linux x64
9898
if: matrix.os == 'ubuntu-latest'
9999
uses: actions/upload-artifact@v5
100100
with:
101101
name: cubic-bot-telegram-app-${{ github.sha }}-linux-x64
102-
path: CubicBot.Telegram.App/bin/Release/net9.0/linux-x64/publish/
102+
path: CubicBot.Telegram.App/bin/Release/net10.0/linux-x64/publish/
103103

104104
- name: Upload CubicBot.Telegram.App artifacts for Linux framework-dependent
105105
if: matrix.os == 'ubuntu-latest'
106106
uses: actions/upload-artifact@v5
107107
with:
108108
name: cubic-bot-telegram-app-${{ github.sha }}-linux
109-
path: CubicBot.Telegram.App/bin/Release/net9.0/publish/
109+
path: CubicBot.Telegram.App/bin/Release/net10.0/publish/
110110

111111
- name: Upload CubicBot.Telegram.App artifacts for Windows ARM64
112112
if: matrix.os == 'windows-latest'
113113
uses: actions/upload-artifact@v5
114114
with:
115115
name: cubic-bot-telegram-app-${{ github.sha }}-windows-arm64
116-
path: CubicBot.Telegram.App/bin/Release/net9.0/win-arm64/publish/
116+
path: CubicBot.Telegram.App/bin/Release/net10.0/win-arm64/publish/
117117

118118
- name: Upload CubicBot.Telegram.App artifacts for Windows x64
119119
if: matrix.os == 'windows-latest'
120120
uses: actions/upload-artifact@v5
121121
with:
122122
name: cubic-bot-telegram-app-${{ github.sha }}-windows-x64
123-
path: CubicBot.Telegram.App/bin/Release/net9.0/win-x64/publish/
123+
path: CubicBot.Telegram.App/bin/Release/net10.0/win-x64/publish/
124124

125125
- name: Upload CubicBot.Telegram.App artifacts for Windows framework-dependent
126126
if: matrix.os == 'windows-latest'
127127
uses: actions/upload-artifact@v5
128128
with:
129129
name: cubic-bot-telegram-app-${{ github.sha }}-windows
130-
path: CubicBot.Telegram.App/bin/Release/net9.0/publish/
130+
path: CubicBot.Telegram.App/bin/Release/net10.0/publish/
131131

132132
- name: Upload CubicBot.Telegram.App artifacts for macOS ARM64
133133
if: matrix.os == 'macos-latest'
134134
uses: actions/upload-artifact@v5
135135
with:
136136
name: cubic-bot-telegram-app-${{ github.sha }}-macos-arm64
137-
path: CubicBot.Telegram.App/bin/Release/net9.0/osx-arm64/publish/
137+
path: CubicBot.Telegram.App/bin/Release/net10.0/osx-arm64/publish/
138138

139139
- name: Upload CubicBot.Telegram.App artifacts for macOS x64
140140
if: matrix.os == 'macos-latest'
141141
uses: actions/upload-artifact@v5
142142
with:
143143
name: cubic-bot-telegram-app-${{ github.sha }}-macos-x64
144-
path: CubicBot.Telegram.App/bin/Release/net9.0/osx-x64/publish/
144+
path: CubicBot.Telegram.App/bin/Release/net10.0/osx-x64/publish/
145145

146146
- name: Upload CubicBot.Telegram.App artifacts for macOS framework-dependent
147147
if: matrix.os == 'macos-latest'
148148
uses: actions/upload-artifact@v5
149149
with:
150150
name: cubic-bot-telegram-app-${{ github.sha }}-macos
151-
path: CubicBot.Telegram.App/bin/Release/net9.0/publish/
151+
path: CubicBot.Telegram.App/bin/Release/net10.0/publish/
152152

153153
# Upload CubicBot.Telegram.Tool
154154
- name: Upload CubicBot.Telegram.Tool artifacts for Linux ARM64
155155
if: matrix.os == 'ubuntu-latest'
156156
uses: actions/upload-artifact@v5
157157
with:
158158
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-arm64
159-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-arm64/publish/
159+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/linux-arm64/publish/
160160

161161
- name: Upload CubicBot.Telegram.Tool artifacts for Linux x64
162162
if: matrix.os == 'ubuntu-latest'
163163
uses: actions/upload-artifact@v5
164164
with:
165165
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-x64
166-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-x64/publish/
166+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/linux-x64/publish/
167167

168168
- name: Upload CubicBot.Telegram.Tool artifacts for Linux framework-dependent
169169
if: matrix.os == 'ubuntu-latest'
170170
uses: actions/upload-artifact@v5
171171
with:
172172
name: cubic-bot-telegram-tool-${{ github.sha }}-linux
173-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/
173+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/publish/
174174

175175
- name: Upload CubicBot.Telegram.Tool artifacts for Windows ARM64
176176
if: matrix.os == 'windows-latest'
177177
uses: actions/upload-artifact@v5
178178
with:
179179
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-arm64
180-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-arm64/publish/
180+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/win-arm64/publish/
181181

182182
- name: Upload CubicBot.Telegram.Tool artifacts for Windows x64
183183
if: matrix.os == 'windows-latest'
184184
uses: actions/upload-artifact@v5
185185
with:
186186
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-x64
187-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-x64/publish/
187+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/win-x64/publish/
188188

189189
- name: Upload CubicBot.Telegram.Tool artifacts for Windows framework-dependent
190190
if: matrix.os == 'windows-latest'
191191
uses: actions/upload-artifact@v5
192192
with:
193193
name: cubic-bot-telegram-tool-${{ github.sha }}-windows
194-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/
194+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/publish/
195195

196196
- name: Upload CubicBot.Telegram.Tool artifacts for macOS ARM64
197197
if: matrix.os == 'macos-latest'
198198
uses: actions/upload-artifact@v5
199199
with:
200200
name: cubic-bot-telegram-tool-${{ github.sha }}-macos-arm64
201-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/osx-arm64/publish/
201+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/osx-arm64/publish/
202202

203203
- name: Upload CubicBot.Telegram.Tool artifacts for macOS x64
204204
if: matrix.os == 'macos-latest'
205205
uses: actions/upload-artifact@v5
206206
with:
207207
name: cubic-bot-telegram-tool-${{ github.sha }}-macos-x64
208-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/osx-x64/publish/
208+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/osx-x64/publish/
209209

210210
- name: Upload CubicBot.Telegram.Tool artifacts for macOS framework-dependent
211211
if: matrix.os == 'macos-latest'
212212
uses: actions/upload-artifact@v5
213213
with:
214214
name: cubic-bot-telegram-tool-${{ github.sha }}-macos
215-
path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/
215+
path: CubicBot.Telegram.Tool/bin/Release/net10.0/publish/

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup dotnet
2424
uses: actions/setup-dotnet@v5
2525
with:
26-
dotnet-version: '9'
26+
dotnet-version: '10'
2727

2828
- name: Restore dependencies
2929
run: dotnet restore
@@ -81,14 +81,14 @@ jobs:
8181
ZSTD_NBTHREADS: 2
8282
run: |
8383
# CubicBot.Telegram.App
84-
cd CubicBot.Telegram.App/bin/Release/net9.0/publish
84+
cd CubicBot.Telegram.App/bin/Release/net10.0/publish
8585
tar -acf ../cubic-bot-telegram-app-${{ github.ref_name }}-linux.tar.zst .
8686
cd ../linux-arm64/publish
8787
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-linux-arm64.tar.zst .
8888
cd ../../linux-x64/publish
8989
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-linux-x64.tar.zst .
9090
# CubicBot.Telegram.Tool
91-
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net9.0/publish
91+
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net10.0/publish
9292
tar -acf ../cubic-bot-telegram-tool-${{ github.ref_name }}-linux.tar.zst .
9393
cd ../linux-arm64/publish
9494
tar -acf ../../cubic-bot-telegram-tool-${{ github.ref_name }}-linux-arm64.tar.zst .
@@ -102,14 +102,14 @@ jobs:
102102
ZSTD_NBTHREADS: 2
103103
run: |
104104
# CubicBot.Telegram.App
105-
cd CubicBot.Telegram.App/bin/Release/net9.0/publish
105+
cd CubicBot.Telegram.App/bin/Release/net10.0/publish
106106
tar -acf ../cubic-bot-telegram-app-${{ github.ref_name }}-osx.tar.zst .
107107
cd ../osx-arm64/publish
108108
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-osx-arm64.tar.zst .
109109
cd ../../osx-x64/publish
110110
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-osx-x64.tar.zst .
111111
# CubicBot.Telegram.Tool
112-
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net9.0/publish
112+
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net10.0/publish
113113
tar -acf ../cubic-bot-telegram-tool-${{ github.ref_name }}-osx.tar.zst .
114114
cd ../osx-arm64/publish
115115
tar -acf ../../cubic-bot-telegram-tool-${{ github.ref_name }}-osx-arm64.tar.zst .
@@ -120,7 +120,7 @@ jobs:
120120
if: matrix.os == 'windows-latest'
121121
run: |
122122
# CubicBot.Telegram.App
123-
cd CubicBot.Telegram.App/bin/Release/net9.0/publish
123+
cd CubicBot.Telegram.App/bin/Release/net10.0/publish
124124
7z a -tzip -mx=9 -mfb=128 ../cubic-bot-telegram-app-${{ github.ref_name }}-windows.zip .
125125
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../cubic-bot-telegram-app-${{ github.ref_name }}-windows.7z .
126126
cd ../win-arm64/publish
@@ -130,7 +130,7 @@ jobs:
130130
7z a -tzip -mx=9 -mfb=128 ../../cubic-bot-telegram-app-${{ github.ref_name }}-windows-x64.zip .
131131
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../cubic-bot-telegram-app-${{ github.ref_name }}-windows-x64.7z .
132132
# CubicBot.Telegram.Tool
133-
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net9.0/publish
133+
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net10.0/publish
134134
7z a -tzip -mx=9 -mfb=128 ../cubic-bot-telegram-tool-${{ github.ref_name }}-windows.zip .
135135
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../cubic-bot-telegram-tool-${{ github.ref_name }}-windows.7z .
136136
cd ../win-arm64/publish
@@ -146,7 +146,7 @@ jobs:
146146
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
147147
with:
148148
repo_token: ${{ secrets.GITHUB_TOKEN }}
149-
file: CubicBot.Telegram.*/bin/Release/net9.0/*.tar.zst
149+
file: CubicBot.Telegram.*/bin/Release/net10.0/*.tar.zst
150150
tag: ${{ github.ref }}
151151
file_glob: true
152152
draft: true
@@ -156,7 +156,7 @@ jobs:
156156
if: matrix.os == 'windows-latest'
157157
with:
158158
repo_token: ${{ secrets.GITHUB_TOKEN }}
159-
file: CubicBot.Telegram.*/bin/Release/net9.0/cubic-bot-telegram-*-windows*.*
159+
file: CubicBot.Telegram.*/bin/Release/net10.0/cubic-bot-telegram-*-windows*.*
160160
tag: ${{ github.ref }}
161161
file_glob: true
162162
draft: true

CubicBot.Telegram.App/CubicBot.Telegram.App.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Worker">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<IsAotCompatible>true</IsAotCompatible>
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.11" />
15+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

CubicBot.Telegram.Tests/CubicBot.Telegram.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66

77
<IsPackable>false</IsPackable>

CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<PropertyGroup>
1212
<OutputType>Exe</OutputType>
13-
<TargetFramework>net9.0</TargetFramework>
13+
<TargetFramework>net10.0</TargetFramework>
1414
<ImplicitUsings>enable</ImplicitUsings>
1515
<Nullable>enable</Nullable>
1616
<IsAotCompatible>true</IsAotCompatible>

CubicBot.Telegram/BotService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace CubicBot.Telegram;
88

9-
public sealed class BotService(ILogger<BotService> logger) : BackgroundService
9+
public sealed partial class BotService(ILogger<BotService> logger) : BackgroundService
1010
{
1111
protected override Task ExecuteAsync(CancellationToken stoppingToken) => RunBotAsync(stoppingToken);
1212

@@ -82,7 +82,7 @@ private async Task RunBotAsync(CancellationToken cancellationToken = default)
8282
}
8383
}
8484

85-
logger.LogInformation("Started Telegram bot: @{BotUsername} ({BotId})", me.Username, me.Id);
85+
LogStartedBot(me.Username, me.Id);
8686

8787
var saveDataTask = SaveDataHourlyAsync(data, cancellationToken);
8888

@@ -96,6 +96,9 @@ private async Task RunBotAsync(CancellationToken cancellationToken = default)
9696
}
9797
}
9898

99+
[LoggerMessage(Level = LogLevel.Information, Message = "Started Telegram bot: @{BotUsername} ({BotId})")]
100+
private partial void LogStartedBot(string botUsername, long botId);
101+
99102
private static readonly TimeSpan s_saveDataInterval = TimeSpan.FromHours(1);
100103

101104
private async Task SaveDataHourlyAsync(Data data, CancellationToken cancellationToken = default)

CubicBot.Telegram/CubicBot.Telegram.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Product>Cubic Telegram Bot</Product>
1414
<RepositoryType>Public</RepositoryType>
1515
<RepositoryUrl>https://github.com/database64128/CubicBot</RepositoryUrl>
16-
<TargetFramework>net9.0</TargetFramework>
16+
<TargetFramework>net10.0</TargetFramework>
1717
<Version>1.2.0</Version>
1818
</PropertyGroup>
1919

@@ -25,13 +25,13 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.11">
28+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
<PrivateAssets>all</PrivateAssets>
3131
</PackageReference>
32-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.11" />
33-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.11" />
34-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.11" />
32+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
33+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0" />
34+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
3535
<PackageReference Include="Telegram.Bot" Version="22.7.6" />
3636
</ItemGroup>
3737

CubicBot.Telegram/UpdateHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public UpdateHandler(string botUsername, Config config, Data data, ILogger logge
2828
}
2929
else
3030
{
31-
_commands = ReadOnlyCollection<CubicBotCommand>.Empty;
31+
_commands = [];
3232
}
3333

3434
if (config.EnableStats)

CubicBot.sln

Lines changed: 0 additions & 43 deletions
This file was deleted.

CubicBot.slnx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Solution>
2+
<Folder Name="/.github/" />
3+
<Folder Name="/.github/workflows/">
4+
<File Path=".github/workflows/build.yml" />
5+
<File Path=".github/workflows/release.yml" />
6+
</Folder>
7+
<Folder Name="/systemd/" />
8+
<Folder Name="/systemd/system/">
9+
<File Path="systemd/system/cubic-bot-telegram.service" />
10+
</Folder>
11+
<Folder Name="/systemd/user/">
12+
<File Path="systemd/user/cubic-bot-telegram.service" />
13+
</Folder>
14+
<Project Path="CubicBot.Telegram.App/CubicBot.Telegram.App.csproj" />
15+
<Project Path="CubicBot.Telegram.Tests/CubicBot.Telegram.Tests.csproj" />
16+
<Project Path="CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj" />
17+
<Project Path="CubicBot.Telegram/CubicBot.Telegram.csproj" />
18+
</Solution>

0 commit comments

Comments
 (0)