diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..9edd317 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,25 @@ +name: CD + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.0.100 + + - name: Pack + run: dotnet pack --configuration Release + + - name: Deploy + run: dotnet nuget push CliFx/bin/Release/*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..10377af --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,22 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.0.100 + + - name: Build & test + run: dotnet test --configuration Release + + - name: Coverage + run: curl -s https://codecov.io/bash | bash -s -- -f CliFx.Tests/bin/Release/Coverage.xml -t ${{secrets.CODECOV_TOKEN}} -Z diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index 661b6c4..90a7d83 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -1,7 +1,7 @@  - net46 + netcoreapp3.0 false true true @@ -10,11 +10,11 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CliFx/CliFx.csproj b/CliFx/CliFx.csproj index ac97c43..abe65a1 100644 --- a/CliFx/CliFx.csproj +++ b/CliFx/CliFx.csproj @@ -15,10 +15,13 @@ https://github.com/Tyrrrz/CliFx git True - True bin/$(Configuration)/$(TargetFramework)/$(AssemblyName).xml + + + + diff --git a/Readme.md b/Readme.md index b36231f..f76849c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,9 @@ # CliFx -[![Build](https://img.shields.io/appveyor/ci/Tyrrrz/CliFx/master.svg)](https://ci.appveyor.com/project/Tyrrrz/CliFx/branch/master) -[![Tests](https://img.shields.io/appveyor/tests/Tyrrrz/CliFx/master.svg)](https://ci.appveyor.com/project/Tyrrrz/CliFx/branch/master/tests) -[![Coverage](https://img.shields.io/codecov/c/gh/Tyrrrz/CliFx/master.svg)](https://codecov.io/gh/Tyrrrz/CliFx) -[![NuGet](https://img.shields.io/nuget/v/CliFx.svg)](https://nuget.org/packages/CliFx) -[![NuGet](https://img.shields.io/nuget/dt/CliFx.svg)](https://nuget.org/packages/CliFx) +[![Build](https://github.com/Tyrrrz/CliFx/workflows/CI/badge.svg?branch=master)](https://github.com/Tyrrrz/CliFx/actions) +[![Coverage](https://codecov.io/gh/Tyrrrz/CliFx/branch/master/graph/badge.svg)](https://codecov.io/gh/Tyrrrz/CliFx) +[![Version](https://img.shields.io/nuget/v/CliFx.svg)](https://nuget.org/packages/CliFx) +[![Downloads](https://img.shields.io/nuget/dt/CliFx.svg)](https://nuget.org/packages/CliFx) [![Donate](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://patreon.com/tyrrrz) [![Donate](https://img.shields.io/badge/buymeacoffee-donate-yellow.svg)](https://buymeacoffee.com/tyrrrz) @@ -15,7 +14,6 @@ _CliFx is to command line interfaces what ASP.NET Core is to web applications._ ## Download - [NuGet](https://nuget.org/packages/CliFx): `dotnet add package CliFx` -- [Continuous integration](https://ci.appveyor.com/project/Tyrrrz/CliFx) ## Features @@ -220,7 +218,7 @@ public class SecondSubCommand : ICommand It is possible to gracefully cancel execution of a command and preform any necessary cleanup. By default an app gets forcefully killed when it receives an interrupt signal (Ctrl+C or Ctrl+Break). You can call `console.GetCancellationToken()` to override the default behavior and get `CancellationToken` that represents the first interrupt signal. Second interrupt signal terminates an app immediately. Note that the code that executes before the first call to `GetCancellationToken` will not be cancellation aware. -You can pass `CancellationToken` around and check its state. +You can pass `CancellationToken` around and check its state. Cancelled or terminated app returns non-zero exit code. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 27f0ee8..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: '{build}' - -image: Visual Studio 2019 -configuration: Release - -before_build: -- dotnet restore - -build: - verbosity: minimal - -after_test: -- choco install codecov && codecov -f "CliFx.Tests/bin/%CONFIGURATION%/Coverage.xml" --required - -artifacts: -- path: CliFx/bin/$(configuration)/CliFx*.nupkg - name: CliFx.nupkg - -deploy: -- provider: NuGet - api_key: - secure: 5VyEaGo5gRLr9HdkRFqS1enRq+K8Qarg1dzU33CE1dOmVXp43JaS2PQTNgsRHXkc - artifact: CliFx.nupkg - on: - branch: master - appveyor_repo_tag: true \ No newline at end of file