Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate nuget org push #2079

Merged
merged 21 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/PushNugetPackageToIntNugetOrg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PushToIntNugetOrg

on:
workflow_dispatch:
stesee marked this conversation as resolved.
Show resolved Hide resolved

env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use

jobs:
PushToIntNugetOrg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: |
dotnet restore lib/PuppeteerSharp.sln
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
- name: Build
run: dotnet build lib/PuppeteerSharp.sln --configuration Release --no-restore
- name: NugetPush to int.nuget.org
env:
NUGET_TOKEN_TEST_EXISTS: ${{ secrets.NUGET_INT_API_KEY }}
if: env.NUGET_TOKEN_TEST_EXISTS != ''
run: |
ls ./lib/PuppeteerSharp/bin/Release
dotnet nuget push ./lib/PuppeteerSharp/bin/Release/*.nupkg --api-key ${{secrets.NUGET_INT_API_KEY}} --source https://apiint.nugettest.org/v3/index.json
34 changes: 34 additions & 0 deletions .github/workflows/PushNugetPackageToNugetOrg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PushToNugetOrg

on:
workflow_dispatch:
push:
tags:
- v*

env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use

jobs:
PushToNugetOrg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: |
dotnet restore lib/PuppeteerSharp.sln
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
- name: Build
run: dotnet build lib/PuppeteerSharp.sln --configuration Release --no-restore
- name: NugetPush to nuget.org
env:
NUGET_TOKEN_EXISTS: ${{ secrets.NUGET_API_KEY }}
if: env.NUGET_TOKEN_EXISTS != ''
run: |
ls ./lib/PuppeteerSharp/bin/Release
dotnet nuget push ./lib/PuppeteerSharp/bin/Release/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

7 changes: 3 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: build

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -16,19 +17,17 @@ env:

jobs:
build:

name: build-${{ matrix.browser }}/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [FIREFOX,CHROME]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' ">net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' ">net6.0</TargetFrameworks>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net48</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' ">net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' ">net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PuppeteerSharp\PuppeteerSharp.csproj" />
Expand Down
3 changes: 2 additions & 1 deletion lib/PuppeteerSharp.Tests/PuppeteerSharp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' ">net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' ">net6.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions lib/PuppeteerSharp.Tests/TestConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.Extensions.Logging;
using PuppeteerSharp.Mobile;
using PuppeteerSharp.Helpers;
using PuppeteerSharp.Mobile;

namespace PuppeteerSharp.Tests
{
public static class TestConstants
{
public const string TestFixtureCollectionName = "PuppeteerLoaderFixture collection";
public const int DebuggerAttachedTestTimeout = 300_000;
public const int DefaultTestTimeout = 30_000;
public const int DefaultTestTimeout = 60_000;
public const int DefaultPuppeteerTimeout = 10_000;
public const int Port = 8081;
public const int HttpsPort = Port + 1;
Expand Down
3 changes: 2 additions & 1 deletion lib/PuppeteerSharp.Xunit/PuppeteerSharp.Xunit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net48</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' ">net48;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' ">net6.0</TargetFrameworks>
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />
</Project>
8 changes: 4 additions & 4 deletions lib/PuppeteerSharp/PuppeteerSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<Description>Headless Browser .NET API</Description>
<PackageId>PuppeteerSharp</PackageId>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageVersion>9.0.0</PackageVersion>
<ReleaseVersion>9.0.0</ReleaseVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<FileVersion>9.0.0.0</FileVersion>
<PackageVersion>9.0.2</PackageVersion>
<ReleaseVersion>9.0.2</ReleaseVersion>
<AssemblyVersion>9.0.2.0</AssemblyVersion>
<FileVersion>9.0.2.0</FileVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
<CodeAnalysisRuleSet>../PuppeteerSharp.ruleset</CodeAnalysisRuleSet>
Expand Down