Skip to content

Commit

Permalink
Test and publish with GitHub Actions (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmekoo authored Apr 9, 2024
1 parent 2442ca3 commit 5bd30ed
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 24 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
[push]

jobs:
test:
runs-on: windows-2019
steps:
- uses: browser-actions/setup-chrome@v1
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test Selone.Tests\Selone.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
- name: Build
run: dotnet build --no-restore
- name: Pack dotnet
run: dotnet pack --configuration Release
- 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 }}


2 changes: 1 addition & 1 deletion Selone.Tests/Selone.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ProjectReference Include="..\Selone\Selone.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Kontur.RetryableAssertions" Version="0.0.2-alpha" />
<PackageReference Include="Kontur.RetryableAssertions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

0 comments on commit 5bd30ed

Please sign in to comment.