Skip to content

Commit

Permalink
[CI] add musl rids
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Mar 27, 2024
1 parent 24cd1b3 commit a4be358
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 115 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/Lagrange.Core-nuget-push.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/Lagrange.OneBot-docker-push.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/Lagrange.OneBot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
linux-x64,
linux-arm,
linux-arm64,
linux-musl-x64,
linux-musl-arm,
linux-musl-arm64,
osx-x64,
osx-arm64,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public Task LoginByQrCode()
{
Collection.Scheduler.Interval(QueryEvent, 2 * 1000, async () => await QueryTransEmpState(async @event =>
{
Collection.Log.LogInfo(Tag, "[X] QrCode Login start");

if (@event.TgtgtKey != null)
{
Collection.Keystore.Stub.TgtgtKey = @event.TgtgtKey;
Expand Down Expand Up @@ -345,11 +343,8 @@ private async Task<bool> DoWtLogin()

private async Task QueryTransEmpState(Func<TransEmpEvent, Task<bool>> callback)
{
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState start");

if (Collection.Keystore.Session.QrString != null)
{
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 1");

var request = new NTLoginHttpRequest
{
Expand All @@ -358,27 +353,20 @@ private async Task QueryTransEmpState(Func<TransEmpEvent, Task<bool>> callback)
FaceUpdateTime = 0
};

Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 1 1");
var payload = JsonSerializer.SerializeToUtf8Bytes(request);
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 1 2");
var response = await Http.PostAsync(Interface, payload, "application/json");
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 1 3");
var info = JsonSerializer.Deserialize<NTLoginHttpResponse>(response);
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 1 4");
if (info != null) Collection.Keystore.Uin = info.Uin;
}

Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 0");
var transEmp = TransEmpEvent.Create(TransEmpEvent.State.QueryResult);
var result = await Collection.Business.SendEvent(transEmp);

if (result.Count != 0)
{
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 2");
var @event = (TransEmpEvent)result[0];
var state = (TransEmp12.State)@event.ResultCode;
Collection.Log.LogInfo(Tag, $"QrCode State Queried: {state} Uin: {Collection.Keystore.Uin}");
Collection.Log.LogInfo(Tag, "[X] QueryTransEmpState branch 2 2");

switch (state)
{
Expand Down
3 changes: 1 addition & 2 deletions Lagrange.OneBot/LagrangeApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ internal LagrangeApp(IHost host)

if (await Instance.FetchQrCode() is { } qrCode)
{
Logger.LogInformation("[X] before qrcode output");
// QrCodeHelper.Output(qrCode.Url ?? "", Configuration.GetValue<bool>("QrCode:ConsoleCompatibilityMode"));
await File.WriteAllBytesAsync($"qr-{Instance.BotUin}.png", qrCode.QrCode ?? Array.Empty<byte>(), cancellationToken);

Logger.LogInformation("[X] qrcode written, to LoginByQrCode");
Logger.LogInformation($"[X] qrcode file generated: qr-{Instance.BotUin}.png");
_ = Task.Run(Instance.LoginByQrCode, cancellationToken);
}
}
Expand Down

0 comments on commit a4be358

Please sign in to comment.