diff --git a/.github/workflows/Lagrange.Core-nuget-push.yml b/.github/workflows/Lagrange.Core-nuget-push.yml deleted file mode 100644 index 53da1f7f3..000000000 --- a/.github/workflows/Lagrange.Core-nuget-push.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Lagrange.Core NuGet Push - -on: - push: - branches: - - master - paths: - - "Lagrange.Core/**" - - "Lagrange.Core.sln" - - "LICENSE" - - "README.md" - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - - name: Pack - run: | - dotnet build -c Release Lagrange.Core - dotnet pack -c Release Lagrange.Core - dotnet pack -c Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg Lagrange.Core - - - name: Add private GitHub registry to NuGet - run: dotnet nuget add source --username Linwenxuan05 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/KonataDev/index.json" - - - name: Push generated package to GitHub registry - run: dotnet nuget push ./Lagrange.Core/bin/Release/*.nupkg --source "github" --skip-duplicate --api-key ${{ secrets.GIT_TOKEN }} - - - name: Push generated package to NuGet - run: dotnet nuget push ./Lagrange.Core/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.NUGETAPIKEY }} diff --git a/.github/workflows/Lagrange.OneBot-docker-push.yml b/.github/workflows/Lagrange.OneBot-docker-push.yml deleted file mode 100644 index 215b1c4ae..000000000 --- a/.github/workflows/Lagrange.OneBot-docker-push.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Lagrange.OneBot Docker Push - -on: - push: - branches: - - master - paths: - - "Lagrange.Core/**" - - "Lagrange.OneBot/**" - - "Lagrange.Core.sln" - - "LICENSE" - pull_request: - branches: - - master - paths: - - "Lagrange.Core/**" - - "Lagrange.OneBot/**" - - "Lagrange.Core.sln" - - "LICENSE" - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Github Registry - uses: docker/login-action@v3 - if: github.event_name != 'pull_request' - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GIT_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ github.repository_owner }}/lagrange.onebot - tags: | - type=edge - type=sha,event=branch - type=ref,event=tag - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: "Lagrange.OneBot/Resources/Dockerfile" - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64, linux/arm64, linux/arm diff --git a/.github/workflows/Lagrange.OneBot-release.yml b/.github/workflows/Lagrange.OneBot-release.yml index 5573760bd..11aac88e5 100644 --- a/.github/workflows/Lagrange.OneBot-release.yml +++ b/.github/workflows/Lagrange.OneBot-release.yml @@ -16,6 +16,9 @@ jobs: linux-x64, linux-arm, linux-arm64, + linux-musl-x64, + linux-musl-arm, + linux-musl-arm64, osx-x64, osx-arm64, ] diff --git a/Lagrange.Core/Internal/Context/Logic/Implementation/WtExchangeLogic.cs b/Lagrange.Core/Internal/Context/Logic/Implementation/WtExchangeLogic.cs index b79ed2c15..d33fc8ca8 100644 --- a/Lagrange.Core/Internal/Context/Logic/Implementation/WtExchangeLogic.cs +++ b/Lagrange.Core/Internal/Context/Logic/Implementation/WtExchangeLogic.cs @@ -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; @@ -345,11 +343,8 @@ private async Task DoWtLogin() private async Task QueryTransEmpState(Func> 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 { @@ -358,27 +353,20 @@ private async Task QueryTransEmpState(Func> 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(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) { diff --git a/Lagrange.OneBot/LagrangeApp.cs b/Lagrange.OneBot/LagrangeApp.cs index 69f6dd770..39337c3f6 100644 --- a/Lagrange.OneBot/LagrangeApp.cs +++ b/Lagrange.OneBot/LagrangeApp.cs @@ -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("QrCode:ConsoleCompatibilityMode")); await File.WriteAllBytesAsync($"qr-{Instance.BotUin}.png", qrCode.QrCode ?? Array.Empty(), cancellationToken); - Logger.LogInformation("[X] qrcode written, to LoginByQrCode"); + Logger.LogInformation($"[X] qrcode file generated: qr-{Instance.BotUin}.png"); _ = Task.Run(Instance.LoginByQrCode, cancellationToken); } }