-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (44 loc) · 1.9 KB
/
publish.yml
File metadata and controls
54 lines (44 loc) · 1.9 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Publish to NuGet and Visual Studio Marketplace
on:
push:
branches:
- main
- 'releases/*'
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "3.1.x"
- name: Restore dependencies
run: dotnet restore Src/FluentAssertionsToShouldlyAnalyzer.sln
- name: Build solution projects
run: |
dotnet build Src/FluentAssertionsToShouldlyAnalyzer/FluentAssertionsToShouldlyAnalyzer --configuration Release --no-restore
dotnet build Src/FluentAssertionsToShouldlyAnalyzer/FluentAssertionsToShouldlyAnalyzer.CodeFixes --configuration Release --no-restore
dotnet build Src/FluentAssertionsToShouldlyAnalyzer/FluentAssertionsToShouldlyAnalyzer.Package --configuration Release --no-restore
dotnet build Src/FluentAssertionsToShouldlyAnalyzer/FluentAssertionsToShouldlyAnalyzer.Test --configuration Release --no-restore
- name: Run Unit Tests and Generate Coverage
uses: glennawatson/coverlet-msbuild@v1
with:
project-files: 'Src/FluentAssertionsToShouldlyAnalyzer/**/*Test.csproj'
no-build: true
output-format: cobertura
output: results
configuration: Release
- name: Pack NuGet package
run: dotnet pack Src/FluentAssertionsToShouldlyAnalyzer/FluentAssertionsToShouldlyAnalyzer.Package/FluentAssertionsToShouldlyAnalyzer.Package.csproj --configuration Release --output ./artifacts
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push ./artifacts/*.nupkg \
--api-key $NUGET_API_KEY \
--source https://apiint.nugettest.org/v3/index.json