-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 1.28 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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/Community.Extensions.Spectre.Cli.Hosting.sln
PROJECT: ./src/Community.Extensions.Spectre.Cli.Hosting/Community.Extensions.Spectre.Cli.Hosting.csproj
CONFIG: Release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- 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.NUGET_API_KEY}} --skip-duplicate --source "https://api.nuget.org/v3/index.json"