ci: Possible CI fix. Breaking RID change. Windows 7 no longer supported :\

refactor: Ayu.Discord.Voice renamed to NadekoBot.Voice to avoid confusion
This commit is contained in:
Kwoth
2024-04-27 19:08:17 +00:00
parent 4a378b9663
commit ddeded9a70
25 changed files with 32 additions and 95 deletions

View File

@@ -33,8 +33,8 @@ build:
script: script:
- "dotnet publish -c Release -r linux-x64 --self-contained -o $LINUX_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r linux-x64 --self-contained -o $LINUX_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
- "dotnet publish -c Release -r linux-arm64 --self-contained -o $LINUX_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r linux-arm64 --self-contained -o $LINUX_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
- "dotnet publish -c Release -r win7-x64 --self-contained -o $WIN_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r win-x64 --self-contained -o $WIN_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
- "dotnet publish -c Release -r win7-arm64 --self-contained -o $WIN_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r win-arm64 --self-contained -o $WIN_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
- "dotnet publish -c Release -r osx-x64 --self-contained -o $MACOS_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r osx-x64 --self-contained -o $MACOS_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
- "dotnet publish -c Release -r osx-arm64 --self-contained -o $MACOS_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r osx-arm64 --self-contained -o $MACOS_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
artifacts: artifacts:

View File

@@ -7,7 +7,7 @@ COPY src/Nadeko.Common/*.csproj src/Nadeko.Common/
COPY src/NadekoBot/*.csproj src/NadekoBot/ COPY src/NadekoBot/*.csproj src/NadekoBot/
COPY src/NadekoBot.Coordinator/*.csproj src/NadekoBot.Coordinator/ COPY src/NadekoBot.Coordinator/*.csproj src/NadekoBot.Coordinator/
COPY src/NadekoBot.Generators/*.csproj src/NadekoBot.Generators/ COPY src/NadekoBot.Generators/*.csproj src/NadekoBot.Generators/
COPY src/ayu/Ayu.Discord.Voice/*.csproj src/ayu/Ayu.Discord.Voice/ COPY src/ayu/NadekoBot.Voice/*.csproj src/ayu/NadekoBot.Voice/
COPY NuGet.Config ./ COPY NuGet.Config ./
RUN dotnet restore src/NadekoBot/ RUN dotnet restore src/NadekoBot/

View File

@@ -436,7 +436,7 @@ public sealed class Help : NadekoModule<HelpService>
ContentType = "application/json", ContentType = "application/json",
ContentBody = uploadData, ContentBody = uploadData,
// either use a path provided in the argument or the default one for public nadeko, other/cmds.json // either use a path provided in the argument or the default one for public nadeko, other/cmds.json
Key = $"cmds/{StatsService.BOT_VERSION}.json", Key = $"cmds/{StatsService.BotVersion}.json",
CannedACL = S3CannedACL.PublicRead CannedACL = S3CannedACL.PublicRead
}); });
} }
@@ -461,11 +461,11 @@ public sealed class Help : NadekoModule<HelpService>
} }
var versionList = JsonSerializer.Deserialize<List<string>>(versionListString); var versionList = JsonSerializer.Deserialize<List<string>>(versionListString);
if (versionList is not null && !versionList.Contains(StatsService.BOT_VERSION)) if (versionList is not null && !versionList.Contains(StatsService.BotVersion))
{ {
// save the file with new version added // save the file with new version added
// versionList.Add(StatsService.BotVersion); // versionList.Add(StatsService.BotVersion);
versionListString = JsonSerializer.Serialize(versionList.Prepend(StatsService.BOT_VERSION), versionListString = JsonSerializer.Serialize(versionList.Prepend(StatsService.BotVersion),
new JsonSerializerOptions new JsonSerializerOptions
{ {
WriteIndented = true WriteIndented = true
@@ -487,7 +487,7 @@ public sealed class Help : NadekoModule<HelpService>
{ {
Log.Warning( Log.Warning(
"Version {Version} already exists in the version file. " + "Did you forget to increment it?", "Version {Version} already exists in the version file. " + "Did you forget to increment it?",
StatsService.BOT_VERSION); StatsService.BotVersion);
} }
} }

View File

@@ -1,5 +1,5 @@
#nullable disable #nullable disable
using Ayu.Discord.Voice; using NadekoBot.Voice;
using System.Reflection; using System.Reflection;
namespace NadekoBot.Modules.Music.Services; namespace NadekoBot.Modules.Music.Services;

View File

@@ -1,5 +1,5 @@
#nullable disable #nullable disable
using Ayu.Discord.Voice; using NadekoBot.Voice;
namespace NadekoBot.Modules.Music; namespace NadekoBot.Modules.Music;

View File

@@ -1,4 +1,4 @@
using Ayu.Discord.Voice; using NadekoBot.Voice;
using NadekoBot.Db.Models; using NadekoBot.Db.Models;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;

View File

@@ -1,6 +1,6 @@
#nullable disable #nullable disable
using Ayu.Discord.Voice; using NadekoBot.Voice;
using Ayu.Discord.Voice.Models; using NadekoBot.Voice.Models;
namespace NadekoBot.Modules.Music; namespace NadekoBot.Modules.Music;

View File

@@ -1,65 +0,0 @@
// using AngleSharp.Html.Dom;
// using MorseCode.ITask;
// using NadekoBot.Modules.Searches.Common;
// using System.Net;
//
// namespace NadekoBot.Modules.Searches.DuckDuckGo;
//
// public sealed class DuckDuckGoSeachService : SearchServiceBase
// {
// private static readonly HtmlParser _googleParser = new(new()
// {
// IsScripting = false,
// IsEmbedded = false,
// IsSupportingProcessingInstructions = false,
// IsKeepingSourceReferences = false,
// IsNotSupportingFrames = true
// });
//
// public override async ITask<SearchResultData> SearchAsync(string query)
// {
// query = WebUtility.UrlEncode(query)?.Replace(' ', '+');
//
// var fullQueryLink = "https://html.duckduckgo.com/html";
//
// using var http = _httpFactory.CreateClient();
// http.DefaultRequestHeaders.Clear();
// http.DefaultRequestHeaders.Add("User-Agent",
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36");
//
// using var formData = new MultipartFormDataContent();
// formData.Add(new StringContent(query), "q");
// using var response = await http.PostAsync(fullQueryLink, formData);
// var content = await response.Content.ReadAsStringAsync();
//
// using var document = await _googleParser.ParseDocumentAsync(content);
// var searchResults = document.QuerySelector(".results");
// var elems = searchResults.QuerySelectorAll(".result");
//
// if (!elems.Any())
// return default;
//
// var results = elems.Select(elem =>
// {
// if (elem.QuerySelector(".result__a") is not IHtmlAnchorElement anchor)
// return null;
//
// var href = anchor.Href;
// var name = anchor.TextContent;
//
// if (string.IsNullOrWhiteSpace(href) || string.IsNullOrWhiteSpace(name))
// return null;
//
// var txt = elem.QuerySelector(".result__snippet")?.TextContent;
//
// if (string.IsNullOrWhiteSpace(txt))
// return null;
//
// return new GoogleSearchResult(name, href, txt);
// })
// .Where(x => x is not null)
// .ToList();
//
// return new(results.AsReadOnly(), fullQueryLink, "0");
// }
// }

View File

@@ -293,7 +293,7 @@ public partial class Utility : NadekoModule
await EmbedAsync(_eb.Create() await EmbedAsync(_eb.Create()
.WithOkColor() .WithOkColor()
.WithAuthor($"NadekoBot v{StatsService.BOT_VERSION}", .WithAuthor($"NadekoBot v{StatsService.BotVersion}",
"https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/avatar.png", "https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/avatar.png",
"https://nadekobot.readthedocs.io/en/latest/") "https://nadekobot.readthedocs.io/en/latest/")
.AddField(GetText(strs.author), _stats.Author, true) .AddField(GetText(strs.author), _stats.Author, true)

View File

@@ -4,7 +4,8 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings> <ImplicitUsings>true</ImplicitUsings>
<Version>5.0.0-beta1</Version> <Version>5.0.0</Version>
<VersionSuffix>beta1</VersionSuffix>
<!-- Output/build --> <!-- Output/build -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>

View File

@@ -7,7 +7,8 @@ namespace NadekoBot.Services;
public sealed class StatsService : IStatsService, IReadyExecutor, INService public sealed class StatsService : IStatsService, IReadyExecutor, INService
{ {
public const string BOT_VERSION = "5.0.0-beta1"; public static string BotVersion
=> typeof(Bot).Assembly.GetName().Version?.ToString(3) ?? "Custom";
public string Author public string Author
=> "Kwoth#2452"; => "Kwoth#2452";

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
internal static unsafe class LibOpus internal static unsafe class LibOpus
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
internal static unsafe class Sodium internal static unsafe class Sodium
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class SelectProtocol public sealed class SelectProtocol
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceHello public sealed class VoiceHello
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceIdentify public sealed class VoiceIdentify
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceReady public sealed class VoiceReady
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceResume public sealed class VoiceResume
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceSessionDescription public sealed class VoiceSessionDescription
{ {

View File

@@ -1,7 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
namespace Ayu.Discord.Voice.Models namespace NadekoBot.Voice.Models
{ {
public sealed class VoiceSpeaking public sealed class VoiceSpeaking
{ {

View File

@@ -5,7 +5,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS8632</NoWarn> <NoWarn>CS8632</NoWarn>
<Version>1.0.2</Version> <Version>1.0.2</Version>
<RootNamespace>Ayu.Discord.Voice</RootNamespace> <RootNamespace>NadekoBot.Voice</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

View File

@@ -4,7 +4,7 @@ using System.Buffers;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
public sealed class PoopyBufferImmortalized : ISongBuffer public sealed class PoopyBufferImmortalized : ISongBuffer
{ {

View File

@@ -4,7 +4,7 @@ using System.Diagnostics;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
public interface ISongBuffer : IDisposable public interface ISongBuffer : IDisposable
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Buffers; using System.Buffers;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
public sealed class VoiceClient : IDisposable public sealed class VoiceClient : IDisposable
{ {

View File

@@ -1,4 +1,4 @@
using Ayu.Discord.Voice.Models; using NadekoBot.Voice.Models;
using Discord.Models.Gateway; using Discord.Models.Gateway;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Serilog; using Serilog;
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
using Ayu.Discord.Gateway; using Ayu.Discord.Gateway;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Ayu.Discord.Voice namespace NadekoBot.Voice
{ {
public class VoiceGateway public class VoiceGateway
{ {