-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (60 loc) · 2.3 KB
/
nuget.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: NuGet
on:
push:
branches:
- main
paths-ignore:
- docs/**
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
include-prerelease: true
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
- name: Clean
run: dotnet clean
- name: NuGet clear cache
run: nuget locals all -clear
- name: Restore tools
run: dotnet tool restore
#- name: Check format
# run: dotnet format --verify-no-changes
- name: Restore dependencies
run: dotnet restore
- name: Check dependencies for deprecated packages
run: dotnet list package --deprecated
- name: Check dependencies for vulnerable packages
run: dotnet list package --vulnerable --include-transitive
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --collect "Code coverage"
- name: Pack
working-directory: src/Science.Cryptography.Ciphers
run: dotnet pack --configuration Release --version-suffix "preview.${{ github.run_number }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Pack
working-directory: src/Science.Cryptography.Ciphers.Specialized
run: dotnet pack --configuration Release --version-suffix "preview.${{ github.run_number }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Pack
working-directory: src/Science.Cryptography.Ciphers.Analysis
run: dotnet pack --configuration Release --version-suffix "preview.${{ github.run_number }}" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Upload artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: packages
path: src/Science.Cryptography.*/bin/Release/Science.Cryptography.*.nupkg
- name: NuGet Authenticate
run: nuget setapikey "${{ secrets.NUGET_API_KEY }}"
- name: NuGet Push
run: nuget push src/Science.Cryptography.*/bin/Release/Science.Cryptography.*.nupkg -Source https://api.nuget.org/v3/index.json
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'