From a18539d29d0714c307fbdc9499489811e194d1b4 Mon Sep 17 00:00:00 2001 From: Artem Kuznetsov Date: Mon, 8 Apr 2024 16:58:01 +0500 Subject: [PATCH] publish with github actions (#6) --- .github/workflows/dotnet.yml | 28 +++++++++++++++++++ .../RetryableAssertions.Tests.csproj | 2 +- appveyor.yml | 23 --------------- 3 files changed, 29 insertions(+), 24 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6aedfee..3865b5c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,3 +23,31 @@ jobs: run: dotnet build Source --no-restore - name: Test run: dotnet test Source\RetryableAssertions.Tests\RetryableAssertions.Tests.csproj --no-build --verbosity normal + + publish: + runs-on: windows-2019 + needs: test + if: github.ref_type == 'tag' + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore Source + - name: Build + run: dotnet build Source --no-restore + - name: Pack dotnet + run: dotnet pack --configuration Release Source + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + path: "**/*.nupkg" + if-no-files-found: error + - name: Publish NuGet + run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --no-symbols --api-key $env:NUGET_API_KEY + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + + diff --git a/Source/RetryableAssertions.Tests/RetryableAssertions.Tests.csproj b/Source/RetryableAssertions.Tests/RetryableAssertions.Tests.csproj index e38d454..76112c2 100644 --- a/Source/RetryableAssertions.Tests/RetryableAssertions.Tests.csproj +++ b/Source/RetryableAssertions.Tests/RetryableAssertions.Tests.csproj @@ -1,6 +1,6 @@  - net45;netcoreapp3.1 + net45;net6.0 Kontur.RetryableAssertions.Tests Kontur.RetryableAssertions.Tests diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5324e0e..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -image: Visual Studio 2019 - -configuration: Release - -install: - - ps: | - nuget restore Source/RetryableAssertions.sln - dotnet restore Source/ - -build: - project: Source/RetryableAssertions.sln - publish_nuget: true - verbosity: minimal - -test: off - -deploy: - - provider: NuGet - api_key: - secure: gKLEfhlRtIFnS9joCT9oqAMx3MC7JArdfpfQlEBocObFG4qigbKJpmGMNtvVCtQ7 - skip_symbols: true - on: - branch: /^master$/