Skip to content

Commit

Permalink
9️⃣ Upgrade to .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
database64128 committed Nov 15, 2024
1 parent babaa05 commit d4bbb74
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,82 +75,82 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux-arm64
path: CubicBot.Telegram.App/bin/Release/net8.0/linux-arm64/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/linux-arm64/publish/

- name: Upload CubicBot.Telegram.App artifacts for Linux x64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux-x64
path: CubicBot.Telegram.App/bin/Release/net8.0/linux-x64/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/linux-x64/publish/

- name: Upload CubicBot.Telegram.App artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-linux
path: CubicBot.Telegram.App/bin/Release/net8.0/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/publish/

- name: Upload CubicBot.Telegram.App artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows-arm64
path: CubicBot.Telegram.App/bin/Release/net8.0/win-arm64/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/win-arm64/publish/

- name: Upload CubicBot.Telegram.App artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows-x64
path: CubicBot.Telegram.App/bin/Release/net8.0/win-x64/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/win-x64/publish/

- name: Upload CubicBot.Telegram.App artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-app-${{ github.sha }}-windows
path: CubicBot.Telegram.App/bin/Release/net8.0/publish/
path: CubicBot.Telegram.App/bin/Release/net9.0/publish/

# Upload CubicBot.Telegram.Tool
- name: Upload CubicBot.Telegram.Tool artifacts for Linux ARM64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-arm64
path: CubicBot.Telegram.Tool/bin/Release/net8.0/linux-arm64/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-arm64/publish/

- name: Upload CubicBot.Telegram.Tool artifacts for Linux x64
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux-x64
path: CubicBot.Telegram.Tool/bin/Release/net8.0/linux-x64/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/linux-x64/publish/

- name: Upload CubicBot.Telegram.Tool artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-linux
path: CubicBot.Telegram.Tool/bin/Release/net8.0/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/

- name: Upload CubicBot.Telegram.Tool artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-arm64
path: CubicBot.Telegram.Tool/bin/Release/net8.0/win-arm64/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-arm64/publish/

- name: Upload CubicBot.Telegram.Tool artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows-x64
path: CubicBot.Telegram.Tool/bin/Release/net8.0/win-x64/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/win-x64/publish/

- name: Upload CubicBot.Telegram.Tool artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubic-bot-telegram-tool-${{ github.sha }}-windows
path: CubicBot.Telegram.Tool/bin/Release/net8.0/publish/
path: CubicBot.Telegram.Tool/bin/Release/net9.0/publish/
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ jobs:
ZSTD_NBTHREADS: 2
run: |
# CubicBot.Telegram.App
cd CubicBot.Telegram.App/bin/Release/net8.0/publish
cd CubicBot.Telegram.App/bin/Release/net9.0/publish
tar -acf ../cubic-bot-telegram-app-${{ github.ref_name }}-linux.tar.zst .
cd ../linux-arm64/publish
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-linux-arm64.tar.zst .
cd ../../linux-x64/publish
tar -acf ../../cubic-bot-telegram-app-${{ github.ref_name }}-linux-x64.tar.zst .
# CubicBot.Telegram.Tool
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net8.0/publish
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net9.0/publish
tar -acf ../cubic-bot-telegram-tool-${{ github.ref_name }}-linux.tar.zst .
cd ../linux-arm64/publish
tar -acf ../../cubic-bot-telegram-tool-${{ github.ref_name }}-linux-arm64.tar.zst .
Expand All @@ -82,7 +82,7 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
# CubicBot.Telegram.App
cd CubicBot.Telegram.App/bin/Release/net8.0/publish
cd CubicBot.Telegram.App/bin/Release/net9.0/publish
7z a -tzip -mx=9 -mfb=128 ../cubic-bot-telegram-app-${{ github.ref_name }}-windows.zip .
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../cubic-bot-telegram-app-${{ github.ref_name }}-windows.7z .
cd ../win-arm64/publish
Expand All @@ -92,7 +92,7 @@ jobs:
7z a -tzip -mx=9 -mfb=128 ../../cubic-bot-telegram-app-${{ github.ref_name }}-windows-x64.zip .
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../cubic-bot-telegram-app-${{ github.ref_name }}-windows-x64.7z .
# CubicBot.Telegram.Tool
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net8.0/publish
cd ../../../../../../CubicBot.Telegram.Tool/bin/Release/net9.0/publish
7z a -tzip -mx=9 -mfb=128 ../cubic-bot-telegram-tool-${{ github.ref_name }}-windows.zip .
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../cubic-bot-telegram-tool-${{ github.ref_name }}-windows.7z .
cd ../win-arm64/publish
Expand All @@ -108,7 +108,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: CubicBot.Telegram.*/bin/Release/net8.0/*.tar.zst
file: CubicBot.Telegram.*/bin/Release/net9.0/*.tar.zst
tag: ${{ github.ref }}
file_glob: true
prerelease: true
Expand All @@ -118,7 +118,7 @@ jobs:
if: matrix.os == 'windows-latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: CubicBot.Telegram.*/bin/Release/net8.0/cubic-bot-telegram-*-windows*.*
file: CubicBot.Telegram.*/bin/Release/net9.0/cubic-bot-telegram-*-windows*.*
tag: ${{ github.ref }}
file_glob: true
prerelease: true
2 changes: 1 addition & 1 deletion CubicBot.Telegram.App/CubicBot.Telegram.App.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-CubicBot.Telegram.App-6b3818c3-5fb6-4bba-91c1-f56f55ecc380</UserSecretsId>
Expand Down
2 changes: 1 addition & 1 deletion CubicBot.Telegram.Tests/CubicBot.Telegram.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>cubic-bot-telegram-tool</AssemblyName>
Expand Down
4 changes: 2 additions & 2 deletions CubicBot.Telegram/Commands/Dice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ private static int GetCountFromArgument(string? argument = null)

private static Task SendAnimatedEmojiAsync(CommandContext commandContext, string emoji, CancellationToken cancellationToken = default)
{
var count = GetCountFromArgument(commandContext.Argument);
var tasks = new Task[count];
int count = GetCountFromArgument(commandContext.Argument);
Span<Task> tasks = new Task[count];

for (var i = 0; i < tasks.Length; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion CubicBot.Telegram/CubicBot.Telegram.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Product>Cubic Telegram Bot</Product>
<RepositoryType>Public</RepositoryType>
<RepositoryUrl>https://github.com/database64128/CubicBot</RepositoryUrl>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Version>1.2.0</Version>
</PropertyGroup>

Expand Down

0 comments on commit d4bbb74

Please sign in to comment.