diff --git a/.github/workflows/dotnet8.yml b/.github/workflows/dotnet8.yml new file mode 100644 index 0000000..d2ac3ca --- /dev/null +++ b/.github/workflows/dotnet8.yml @@ -0,0 +1,50 @@ +name: .NET 8 + +on: + workflow_dispatch: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +defaults: + run: + working-directory: ./PuppeteerExtraSharp + +jobs: + build: + strategy: + matrix: + platform: [ ubuntu-latest, macos-latest, windows-latest ] + version: [ 8.x ] + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ matrix.version }} + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + + publish_nuget: + needs: [ build ] + environment: 'Production Nuget' + runs-on: ubuntu-latest + if: github.ref_name == 'master' && github.event_name == 'push' + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore -c Release + - name: Publish TakasakiStudio.PuppeteerExtraSharp to Nuget + run: dotnet nuget push "./PuppeteerExtraSharp/bin/Release/*.nupkg" --api-key ${{ secrets.SECRET }} --source "nuget.org" \ No newline at end of file diff --git a/PuppeteerExtraSharp/PuppeteerExtraSharp.sln b/PuppeteerExtraSharp/PuppeteerExtraSharp.sln index f6d2bab..0d7490b 100644 --- a/PuppeteerExtraSharp/PuppeteerExtraSharp.sln +++ b/PuppeteerExtraSharp/PuppeteerExtraSharp.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PuppeteerExtraSharp", "PuppeteerExtraSharp.csproj", "{B2221B32-DFAE-4F87-B0EC-EE4922B81F64}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extra.Tests", "..\tests\Extra.Tests.csproj", "{FB432A25-A844-4C78-9194-E46D806B46E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extra.Tests", "..\Tests\Extra.Tests.csproj", "{FB432A25-A844-4C78-9194-E46D806B46E5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Tests/BrowserDefault.cs b/Tests/BrowserDefault.cs index 94182e6..9feee52 100644 --- a/Tests/BrowserDefault.cs +++ b/Tests/BrowserDefault.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Text; using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using PuppeteerExtraSharp; using PuppeteerExtraSharp.Plugins; using PuppeteerSharp; @@ -61,7 +58,7 @@ private async void DownloadChromeIfNotExists() await new BrowserFetcher(new BrowserFetcherOptions() { Path = Constants.PathToChrome - }).DownloadAsync(BrowserFetcher.DefaultChromiumRevision); + }).DownloadAsync(BrowserTag.Latest); } protected LaunchOptions CreateDefaultOptions() diff --git a/Tests/Recaptcha/AntiCaptcha/AntiCaptchaTests.cs b/Tests/Recaptcha/AntiCaptcha/AntiCaptchaTests.cs index 6cd3b46..2a22813 100644 --- a/Tests/Recaptcha/AntiCaptcha/AntiCaptchaTests.cs +++ b/Tests/Recaptcha/AntiCaptcha/AntiCaptchaTests.cs @@ -47,7 +47,7 @@ public async Task ShouldSolveCaptchaWithSubmitButton() var button = await page.QuerySelectorAsync("input[type='submit']"); await button.ClickAsync(); - await page.WaitForTimeoutAsync(1000); + await Task.Delay(1000); await CheckSuccessVerify(page); } @@ -62,7 +62,7 @@ public async void ShouldSolveCaptchaWithCallback() Assert.Null(result.Exception); - await page.WaitForTimeoutAsync(1000); + await Task.Delay(1000); await CheckSuccessVerify(page); }