-
Notifications
You must be signed in to change notification settings - Fork 299
60 lines (48 loc) · 1.49 KB
/
nuget.yaml
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
name: Nuget
on:
release:
types: [ released ]
jobs:
nuget:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: dotnet restore
run: dotnet restore --verbosity minimal --configfile nuget.config
- name: dotnet test
run: dotnet test
- name: dotnet pack
run: dotnet pack -c Release src/nuget.proj -o pkg --include-symbols
- name: dotnet nuget push
run: |
dotnet nuget push pkg\*.nupkg -s https://nuget.pkg.github.com/$env:GITHUB_REPOSITORY_OWNER -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }} --skip-duplicate
## Remove old versions of NuGet packages form github NuGet feed
nuget-delete-old-packages:
name: "Delete Old NuGet"
needs: [nuget]
strategy:
matrix:
nuget-package:
- "KubernetesClient"
- "KubernetesClient.Classic"
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Delete old NuGet packages
uses: actions/delete-package-versions@v5
with:
owner: ${{ env.GITHUB_REPOSITORY_OWNER }}
token: ${{ secrets.GITHUB_TOKEN }}
package-name: ${{ matrix.nuget-package }}
package-type: nuget
min-versions-to-keep: 10