Skip to content

Commit 566cc06

Browse files
author
Ahmad Noman Musleh
committed
Updated release action
1 parent c4ac8de commit 566cc06

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/publish_nuget_package_released.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,33 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-latest
9+
runs-on: windows-latest
1010

1111
steps:
1212
- uses: actions/checkout@v2
13+
14+
- name: Setup NuGet
15+
uses: NuGet/setup-nuget@v1.0.5
16+
with:
17+
nuget-api-key: ${{secrets.NUGET_API_KEY}}
18+
nuget-version: 'latest'
19+
1320
- name: Setup .NET
1421
uses: actions/setup-dotnet@v1
1522
with:
1623
dotnet-version: '6.0.x'
17-
- name: Install dependencies
18-
run: dotnet restore src/OpenAPI.Net/OpenAPI.Net.csproj
24+
25+
- name: Restore dependencies
26+
run: dotnet restore ./src/OpenAPI.Net/OpenAPI.Net.csproj
27+
1928
- name: Build
20-
run: dotnet build src/OpenAPI.Net/OpenAPI.Net.csproj --configuration Release --no-restore
21-
- name: Publish on release
22-
uses: rohith/publish-nuget@v2
23-
with:
24-
PROJECT_FILE_PATH: src/OpenAPI.Net/OpenAPI.Net.csproj
25-
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
29+
run: dotnet build ./src/OpenAPI.Net/OpenAPI.Net.csproj --configuration Release --no-restore
30+
31+
- name: Decrypt Certificate
32+
run: .\FileEncrypt decrypt .\certificate.pfx.encrypted ${{secrets.CERTIFICATE_DECRYPTION_KEY}} ${{secrets.CERTIFICATE_DECRYPTION_IV}}
33+
34+
- name: Sign Package
35+
run: nuget sign **\*.nupkg -CertificatePath certificate.pfx -Timestamper http://timestamp.digicert.com/ -CertificatePassword ${{secrets.CERTIFICATE_PASSWORD}} -NonInteractive
36+
37+
- name: Publish Package
38+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json'

0 commit comments

Comments
 (0)