-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathpublish_nuget_package_released.yml
More file actions
38 lines (28 loc) · 1.1 KB
/
Copy pathpublish_nuget_package_released.yml
File metadata and controls
38 lines (28 loc) · 1.1 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
name: Publish Nuget Package When Released
on:
release:
types: [released]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
nuget-version: 'latest'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore ./src/OpenAPI.Net/OpenAPI.Net.csproj
- name: Build
run: dotnet build ./src/OpenAPI.Net/OpenAPI.Net.csproj --configuration Release --no-restore
- name: Decrypt Certificate
run: .\FileEncrypt decrypt .\certificate.pfx.encrypted ${{secrets.CERTIFICATE_DECRYPTION_KEY}} ${{secrets.CERTIFICATE_DECRYPTION_IV}}
- name: Sign Package
run: nuget sign **\*.nupkg -CertificatePath certificate.pfx -Timestamper http://timestamp.digicert.com/ -CertificatePassword ${{secrets.CERTIFICATE_PASSWORD}} -NonInteractive
- name: Publish Package
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json'