Skip to content

Commit

Permalink
Merge pull request #1 from Takasaki-Studio/ci
Browse files Browse the repository at this point in the history
Add: github publish
  • Loading branch information
Takasakiii authored May 18, 2024
2 parents 7cefa07 + 52db68f commit b1f755e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/dotnet8.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion PuppeteerExtraSharp/PuppeteerExtraSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions Tests/BrowserDefault.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions Tests/Recaptcha/AntiCaptcha/AntiCaptchaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -62,7 +62,7 @@ public async void ShouldSolveCaptchaWithCallback()

Assert.Null(result.Exception);

await page.WaitForTimeoutAsync(1000);
await Task.Delay(1000);
await CheckSuccessVerify(page);
}

Expand Down

0 comments on commit b1f755e

Please sign in to comment.