forked from FriendsOfCADability/CADability
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (30 loc) · 1.09 KB
/
nuget.yml
File metadata and controls
40 lines (30 loc) · 1.09 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
name: Publish NuGet Package
on:
push:
tags:
- 'v*' # Trigger on version tags like v1.0.0
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore CADability/CADability.csproj
- name: Build
run: dotnet build CADability/CADability.csproj -c Release --no-restore
- name: List build output
run: dir CADability\bin\Release\netstandard2.0
- name: Pack
run: dotnet pack CADability/CADability.csproj -c Release --no-build -o ./nupkgs
- name: List nupkg
run: dir .\nupkgs
- name: Push NuGet package
run: |
$version = "${{ github.ref_name }}" -replace '^v', ''
$pkg = Get-ChildItem -Path ./nupkgs -Filter "*$version.nupkg" | Select-Object -First 1
dotnet nuget push $pkg.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json