v16.0.2 #194
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |