-
-
Notifications
You must be signed in to change notification settings - Fork 89
43 lines (34 loc) · 1.39 KB
/
publish_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
name: Publish NuGet
on:
workflow_dispatch:
inputs:
version:
description: 'Package version override'
required: false
default: ''
jobs:
build:
runs-on: windows-latest
steps:
- name: Clone NmeaParser
uses: actions/checkout@v1
- name: Setup Visual Studio Command Prompt
uses: microsoft/[email protected]
- name: Get certificate
id: cert_file
uses: timheuer/base64-to-file@master
with:
fileName: 'certfile.pfx'
encodedString: ${{ secrets.BASE64_ENCODED_PFX }}
- name: Build
run: |
msbuild /restore /t:Build src/NmeaParser/NmeaParser.csproj /p:Configuration=Release /p:CertificatePath=${{ steps.cert_file.outputs.filePath }} /p:CertificatePassword=${{ secrets.PFX_PASSWORD }} /p:Version=${{ github.event.inputs.version }}
- name: Sign NuGet Package
run: nuget sign artifacts\NuGet\Release\*.nupkg -CertificatePath ${{ steps.cert_file.outputs.filePath }} -CertificatePassword ${{ secrets.PFX_PASSWORD }} -Timestamper http://timestamp.digicert.com -NonInteractive
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: artifacts/NuGet/Release
- name: Push to NuGet
run: dotnet nuget push artifacts\NuGet\Release\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org