Skip to content

Added a sample dependency to show commands can use injected services … #8

Added a sample dependency to show commands can use injected services …

Added a sample dependency to show commands can use injected services … #8

Workflow file for this run

# 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: Build and Publish
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
SOLUTION: ./src/Spectre.Console.Extensions.Hosting.sln
PROJECT: ./src/Spectre.Console.Extensions.Hosting/Spectre.Console.Extensions.Hosting.csproj
CONFIG: Release
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ${{ env.SOLUTION }} --no-cache
- name: Build
run: dotnet build ${{ env.SOLUTION }} --no-restore -c ${{ env.CONFIG }}
- name: Test
run: dotnet test ${{ env.SOLUTION }} --no-build --verbosity normal --configuration ${{ env.CONFIG }}
- name: Package
run: dotnet pack ${{ env.PROJECT }} --no-build -c ${{ env.CONFIG }} --output ./publish
- name: Publish
run: dotnet nuget push ./publish/*.nupkg --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate